Queue sysfs files¶
This text file will detail the queue files that are located in the sysfs treefor each block device. Note that stacked devices typically do not exportany settings, since their queue merely functions are a remapping target.These files are the ones found in the /sys/block/xxx/queue/ directory.
Files denoted with a RO postfix are readonly and the RW postfix meansread-write.
add_random (RW)¶
This file allows to turn off the disk entropy contribution. Defaultvalue of this file is ‘1’(on).
chunk_sectors (RO)¶
This has different meaning depending on the type of the block device.For a RAID device (dm-raid), chunk_sectors indicates the size in 512B sectorsof the RAID volume stripe segment. For a zoned block device, either host-awareor host-managed, chunk_sectors indicates the size in 512B sectors of the zonesof the device, with the eventual exception of the last zone of the device whichmay be smaller.
dax (RO)¶
This file indicates whether the device supports Direct Access (DAX),used by CPU-addressable storage to bypass the pagecache. It shows ‘1’if true, ‘0’ if not.
discard_granularity (RO)¶
This shows the size of internal allocation of the device in bytes, ifreported by the device. A value of ‘0’ means device does not supportthe discard functionality.
discard_max_hw_bytes (RO)¶
Devices that support discard functionality may have internal limits onthe number of bytes that can be trimmed or unmapped in a single operation.The discard_max_bytes parameter is set by the device driver to the maximumnumber of bytes that can be discarded in a single operation. Discardrequests issued to the device must not exceed this limit. A discard_max_bytesvalue of 0 means that the device does not support discard functionality.
discard_max_bytes (RW)¶
While discard_max_hw_bytes is the hardware limit for the device, thissetting is the software limit. Some devices exhibit large latencies whenlarge discards are issued, setting this value lower will make Linux issuesmaller discards and potentially help reduce latencies induced by largediscard operations.
discard_zeroes_data (RO)¶
Obsolete. Always zero.
fua (RO)¶
Whether or not the block driver supports the FUA flag for write requests.FUA stands for Force Unit Access. If the FUA flag is set that means thatwrite requests must bypass the volatile cache of the storage device.
hw_sector_size (RO)¶
This is the hardware sector size of the device, in bytes.
io_poll (RW)¶
When read, this file shows whether polling is enabled (1) or disabled(0). Writing ‘0’ to this file will disable polling for this device.Writing any non-zero value will enable this feature.
io_poll_delay (RW)¶
If polling is enabled, this controls what kind of polling will beperformed. It defaults to -1, which is classic polling. In this mode,the CPU will repeatedly ask for completions without giving up any time.If set to 0, a hybrid polling mode is used, where the kernel will attemptto make an educated guess at when the IO will complete. Based on thisguess, the kernel will put the process issuing IO to sleep for an amountof time, before entering a classic poll loop. This mode might be alittle slower than pure classic polling, but it will be more efficient.If set to a value larger than 0, the kernel will put the process issuingIO to sleep for this amount of microseconds before entering classicpolling.
io_timeout (RW)¶
io_timeout is the request timeout in milliseconds. If a request does notcomplete in this time then the block driver timeout handler is invoked.That timeout handler can decide to retry the request, to fail it or to starta device recovery strategy.
iostats (RW)¶
This file is used to control (on/off) the iostats accounting of thedisk.
logical_block_size (RO)¶
This is the logical block size of the device, in bytes.
max_discard_segments (RO)¶
The maximum number of DMA scatter/gather entries in a discard request.
max_hw_sectors_kb (RO)¶
This is the maximum number of kilobytes supported in a single data transfer.
max_integrity_segments (RO)¶
Maximum number of elements in a DMA scatter/gather list with integritydata that will be submitted by the block layer core to the associatedblock driver.
max_active_zones (RO)¶
For zoned block devices (zoned attribute indicating “host-managed” or“host-aware”), the sum of zones belonging to any of the zone states:EXPLICIT OPEN, IMPLICIT OPEN or CLOSED, is limited by this value.If this value is 0, there is no limit.
max_open_zones (RO)¶
For zoned block devices (zoned attribute indicating “host-managed” or“host-aware”), the sum of zones belonging to any of the zone states:EXPLICIT OPEN or IMPLICIT OPEN, is limited by this value.If this value is 0, there is no limit.
max_sectors_kb (RW)¶
This is the maximum number of kilobytes that the block layer will allowfor a filesystem request. Must be smaller than or equal to the maximumsize allowed by the hardware.
max_segments (RO)¶
Maximum number of elements in a DMA scatter/gather list that is submittedto the associated block driver.
max_segment_size (RO)¶
Maximum size in bytes of a single element in a DMA scatter/gather list.
minimum_io_size (RO)¶
This is the smallest preferred IO size reported by the device.
nomerges (RW)¶
This enables the user to disable the lookup logic involved with IOmerging requests in the block layer. By default (0) all merges areenabled. When set to 1 only simple one-hit merges will be tried. Whenset to 2 no merge algorithms will be tried (including one-hit or morecomplex tree/hash lookups).
nr_requests (RW)¶
This controls how many requests may be allocated in the block layer forread or write requests. Note that the total allocated number may be twicethis amount, since it applies only to reads or writes (not the accumulatedsum).
To avoid priority inversion through request starvation, a requestqueue maintains a separate request pool per each cgroup whenCONFIG_BLK_CGROUP is enabled, and this parameter applies to each suchper-block-cgroup request pool. IOW, if there are N block cgroups,each request queue may have up to N request pools, each independentlyregulated by nr_requests.
nr_zones (RO)¶
For zoned block devices (zoned attribute indicating “host-managed” or“host-aware”), this indicates the total number of zones of the device.This is always 0 for regular block devices.
optimal_io_size (RO)¶
This is the optimal IO size reported by the device.
physical_block_size (RO)¶
This is the physical block size of device, in bytes.
read_ahead_kb (RW)¶
Maximum number of kilobytes to read-ahead for filesystems on this blockdevice.
rotational (RW)¶
This file is used to stat if the device is of rotational type ornon-rotational type.
rq_affinity (RW)¶
If this option is ‘1’, the block layer will migrate request completions to thecpu “group” that originally submitted the request. For some workloads thisprovides a significant reduction in CPU cycles due to caching effects.
For storage configurations that need to maximize distribution of completionprocessing setting this option to ‘2’ forces the completion to run on therequesting cpu (bypassing the “group” aggregation logic).
scheduler (RW)¶
When read, this file will display the current and available IO schedulersfor this block device. The currently active IO scheduler will be enclosedin [] brackets. Writing an IO scheduler name to this file will switchcontrol of this block device to that new IO scheduler. Note that writingan IO scheduler name to this file will attempt to load that IO schedulermodule, if it isn’t already present in the system.
write_cache (RW)¶
When read, this file will display whether the device has write backcaching enabled or not. It will return “write back” for the formercase, and “write through” for the latter. Writing to this file canchange the kernels view of the device, but it doesn’t alter thedevice state. This means that it might not be safe to toggle thesetting from “write back” to “write through”, since that will alsoeliminate cache flushes issued by the kernel.
write_same_max_bytes (RO)¶
This is the number of bytes the device can write in a single write-samecommand. A value of ‘0’ means write-same is not supported by thisdevice.
wbt_lat_usec (RW)¶
If the device is registered for writeback throttling, then this file showsthe target minimum read latency. If this latency is exceeded in a givenwindow of time (see wb_window_usec), then the writeback throttling will startscaling back writes. Writing a value of ‘0’ to this file disables thefeature. Writing a value of ‘-1’ to this file resets the value to thedefault setting.
throttle_sample_time (RW)¶
This is the time window that blk-throttle samples data, in millisecond.blk-throttle makes decision based on the samplings. Lower time means cgroupshave more smooth throughput, but higher CPU overhead. This exists only whenCONFIG_BLK_DEV_THROTTLING_LOW is enabled.
write_zeroes_max_bytes (RO)¶
For block drivers that support REQ_OP_WRITE_ZEROES, the maximum number ofbytes that can be zeroed at once. The value 0 means that REQ_OP_WRITE_ZEROESis not supported.
zoned (RO)¶
This indicates if the device is a zoned block device and the zone model of thedevice if it is indeed zoned. The possible values indicated by zoned are“none” for regular block devices and “host-aware” or “host-managed” for zonedblock devices. The characteristics of host-aware and host-managed zoned blockdevices are described in the ZBC (Zoned Block Commands) and ZAC(Zoned Device ATA Command Set) standards. These standards also define the“drive-managed” zone model. However, since drive-managed zoned block devicesdo not support zone commands, they will be treated as regular block devicesand zoned will report “none”.
Jens Axboe <jens.axboe@oracle.com>, February 2009