Appendix A. XFS System-Tunable Kernel Parameters

This appendix discusses the following:

Overview of the XFS System-Tunable Kernel Parameters

This section discusses the following:

Using Appropriate Parameter Settings

All XFS parameters are dynamic. Before changing any parameter, you should understand the ramifications of doing so on your system. You should change debugging parameters only at the recommendation of SGI Support.

The values of these parameters vary in different releases of the product. When upgrading the product, consult SGI Support to determine whether any changes made to the parameters in this chapter should be carried forward. Setting these parameters incorrectly may render the system unstable or otherwise unusable.

Time Unit of Measure

Times are measured in centisecs (100ths of a second).

Prefix

Each of the parameters uses a prefix of fs.xfs. For example, the full name of the stats_clear parameter is fs.xfs.stats_clear.

Permanently Changing a Parameter

To ensure that a parameter is set upon reboot, modify or create a line like the following in the /etc/modprobe.d/sgi-xfs.conf file or equivalent:

install xfs /sbin/modprobe --ignore-install xfs; echo value > /proc/sys/fs/xfs/systune

where:

  • value is the value you want to set

  • systune is the parameter name

For example, to permanently set the rotorstep parameter to 255:

install xfs /sbin/modprobe --ignore-install xfs; echo 255 >/proc/sys/fs/xfs/rotorstep

The change will take effect upon reboot.


Note: This is the recommended method to permanently set an XFS system tunable parameter. Setting the parameter in the /etc/sysctl.conf file is not recommended because the file may be parsed at boot time before the xfs module is loaded.


Temporarily Changing a Parameter

For a temporary change to a dynamic parameter, use the Linux sysctl(8) command as follows:

# sysctl -w "fs.xfs.systune=value"

where:

  • systune is the parameter name

  • value is the value you want to set for the parameter


Note: Do not use spaces around the = character.

For example, to temporarily set the rotorstep parameter (which has the fs.xfs prefix) to 255, enter the following:

# sysctl fs.xfs.rotorstep=255
fs.xfs.rotorstep = 255

Querying a Current Parameter Setting

To query the current setting of a parameter, use the Linux sysctl(8) command:

# sysctl fs.xfs.systune 

where:

  • systune is the parameter name

For example, to query the current setting of the rotorstep parameter (which has the fs.xfs prefix):

# sysctl fs.xfs.rotorstep
rotorstep = 255

Parameter Types

This section discusses the following:

Parameters to Set at Initial Configuration

Most of the dynamic parameters in this section affect the behavior of all mounted XFS filesystems, therefore you should set them at initial configuration and you should change them only to follow the desired site policy:

inherit_noatim

Specifies whether the noatim flag set by the xfs_io(8) chattr command will be inherited by files in a given directory.

Range of values:

  • 0 prevents inheritance

  • 1 causes the noatim

    flag to be inherited

inherit_nodfrg

Specifies whether the nodfrg flag set by the xfs_io(8) chattr command will be inherited by files in a given directory.

Range of values:

  • 0 prevents inheritance

  • 1 causes the nodfrg flag to be inherited

inherit_nodump

Specifies whether the nodump flag set by the xfs_io(8) chattr command will be inherited by files in a given directory.

Range of values:

  • 0 prevents inheritance

  • 1 causes the nodump flag to be inherited

inherit_nosym

Specifies whether the nosymlinks flag set by the xfs_io(8) chattr command will be inherited by files in a given directory.

Range of values:

  • 0 prevents inheritance

  • 1 causes the nosymlinks flag to be inherited

inherit_sync

Specifies whether the sync flag set by the xfs_io(8) chattr command will be inherited by files in a given directory.

Range of values:

  • 0 prevents inheritance

  • 1 causes the sync flag to be inherited

sgid_inherit

Controls the action taken for a file created in a set group ID (SGID) directory if the group ID of the new file does not match the effective group ID or one of the supplementary group IDs of the parent directory.

Range of values:

  • 0 does not clear the S_ISGID bit

  • 1 clears the S_ISGID bit

stats_clear

Specifies whether or not the accumulated XFS statistics in the /proc/fs/xfs/stat file are cleared

Range of values:

  • 0 does not change the file

  • 1 resets the statistics in the file to 0

symlink_mode

Controls the permissions set for symbolic links.

Range of values:

  • 0 creates symbolic links with mode 0777 (default)

  • 1 specifies that the umask value is used

Mount-Time Parameter for Initial Configuration

The parameter in this section affects the behavior of all mounted XFS filesystems, therefore you should it at initial configuration and you should change it only to follow the desired site policy. Changes to this parameter takes effect at mount time.

probe_dmapi

Determines whether or not XFS attempts to load the xfs_dmapi module and enable the dmi/ dmapi/xdsm mount option when mounting a filesystem.

Range of values:

  • 0 does not load the module or enable the mount option

  • 1 loads the module and enable the mount option

Parameters for Special-Case Performance Tuning

The default values for the following dynamic parameters are optimal for most workload, and you should take extra caution when changing them for performance tuning:

probe_limit


Note: The probe_limit parameter is part of enhanced XFS.

Specifies the maximum number of pages that XFS will cluster together when probing, in order to optimize the conversion of delayed allocation or unwritten extents into real extents.

Range of values:

  • Default: 4096 (0x1000)

  • Minimum: 0

  • Maximum: 2097151 (0x1fffff)

rotorstep

In inode32 allocation mode, determines how many files the allocator attempts to allocate before moving to the next allocation group. The intent is to control the rate at which the allocator moves between allocation groups when allocating extents for new files.

Range of values:

  • Default: 1

  • Minimum: 1

  • Maximum: 255

See also:

syncd_timer

Specifies the interval (in centiseconds) at which the xfssyncd thread flushes metadata such as log activity out to disk does some processing on unlinked inodes.

Range of values:

  • Default: 3000

  • Minimum: 100

  • Maximum: 720000

xfs_buf_age

Specifies the age (in centiseconds) at which xfsbufd flushes dirty metadata buffers to disk.

Range of values:

  • Default: 1500

  • Minimum: 100

  • Maximum: 720000

xfs_buf_timer

Specifies the interval (in centiseconds) at which xfsbufd scans the dirty metadata buffers list.

Range of values:

  • Default: 100

  • Minimum: 50

  • Maximum: 3000

Mount-Time Parameter for Special-Case Performance Tuning

The default value for the following parameter is optimal for most workload, and you should take extra caution when changing it for performance tuning. Changes to this parameter takes effect at mount time.

fstrm_timer

Specifies the filestream timer, which is the required time interval (in centiseconds) between file creates in a directory to maintain a stream of files.

Range of values:

  • Default: 3000

  • Minimum: 1

  • Maximum: 360000

Debugging Parameters Restricted to SGI Support


Caution: Do not change these parameters unless instructed to do so by SGI Support.

This section discusses debugging parameters that should be changed at the recommendation of SGI Support:

error_level

Specifies the reporting volume when internal errors occur, such as the number of detailed messages and backtraces for filesystem shutdowns. XFS macros use the following threshold values:

XFS_ERRLEVEL_OFF is 0
XFS_ERRLEVEL_LOW is 3
XFS_ERRLEVEL_HIGH is 5

Range of values:

  • Default: 3

  • Minimum: 0 (turns off error reporting)

  • Maximum: 11

panic_mask

Specifies a bitmask that causes certain error conditions to call BUG(). The value is the AND value of the following tags representing errors that should cause panics:

XFS_NO_PTAG                     0
XFS_PTAG_IFLUSH                 0x00000001
XFS_PTAG_LOGRES                 0x00000002
XFS_PTAG_AILDELETE              0x00000004
XFS_PTAG_ERROR_REPORT           0x00000008
XFS_PTAG_SHUTDOWN_CORRUPT       0x00000010
XFS_PTAG_SHUTDOWN_IOERROR       0x00000020
XFS_PTAG_SHUTDOWN_LOGERROR      0x00000040

Range of values:

  • Default: 0

  • Minimum: 0

  • Maximum: 255