1Queue sysfs files 2================= 3 4This text file will detail the queue files that are located in the sysfs tree 5for each block device. Note that stacked devices typically do not export 6any settings, since their queue merely functions are a remapping target. 7These files are the ones found in the /sys/block/xxx/queue/ directory. 8 9Files denoted with a RO postfix are readonly and the RW postfix means 10read-write. 11 12add_random (RW) 13---------------- 14This file allows to turn off the disk entropy contribution. Default 15value of this file is '1'(on). 16 17discard_granularity (RO) 18----------------------- 19This shows the size of internal allocation of the device in bytes, if 20reported by the device. A value of '0' means device does not support 21the discard functionality. 22 23discard_max_bytes (RO) 24---------------------- 25Devices that support discard functionality may have internal limits on 26the number of bytes that can be trimmed or unmapped in a single operation. 27The discard_max_bytes parameter is set by the device driver to the maximum 28number of bytes that can be discarded in a single operation. Discard 29requests issued to the device must not exceed this limit. A discard_max_bytes 30value of 0 means that the device does not support discard functionality. 31 32discard_zeroes_data (RO) 33------------------------ 34When read, this file will show if the discarded block are zeroed by the 35device or not. If its value is '1' the blocks are zeroed otherwise not. 36 37hw_sector_size (RO) 38------------------- 39This is the hardware sector size of the device, in bytes. 40 41iostats (RW) 42------------- 43This file is used to control (on/off) the iostats accounting of the 44disk. 45 46logical_block_size (RO) 47----------------------- 48This is the logcal block size of the device, in bytes. 49 50max_hw_sectors_kb (RO) 51---------------------- 52This is the maximum number of kilobytes supported in a single data transfer. 53 54max_integrity_segments (RO) 55--------------------------- 56When read, this file shows the max limit of integrity segments as 57set by block layer which a hardware controller can handle. 58 59max_sectors_kb (RW) 60------------------- 61This is the maximum number of kilobytes that the block layer will allow 62for a filesystem request. Must be smaller than or equal to the maximum 63size allowed by the hardware. 64 65max_segments (RO) 66----------------- 67Maximum number of segments of the device. 68 69max_segment_size (RO) 70--------------------- 71Maximum segment size of the device. 72 73minimum_io_size (RO) 74-------------------- 75This is the smallest preferred IO size reported by the device. 76 77nomerges (RW) 78------------- 79This enables the user to disable the lookup logic involved with IO 80merging requests in the block layer. By default (0) all merges are 81enabled. When set to 1 only simple one-hit merges will be tried. When 82set to 2 no merge algorithms will be tried (including one-hit or more 83complex tree/hash lookups). 84 85nr_requests (RW) 86---------------- 87This controls how many requests may be allocated in the block layer for 88read or write requests. Note that the total allocated number may be twice 89this amount, since it applies only to reads or writes (not the accumulated 90sum). 91 92To avoid priority inversion through request starvation, a request 93queue maintains a separate request pool per each cgroup when 94CONFIG_BLK_CGROUP is enabled, and this parameter applies to each such 95per-block-cgroup request pool. IOW, if there are N block cgroups, 96each request queue may have up to N request pools, each independently 97regulated by nr_requests. 98 99optimal_io_size (RO) 100-------------------- 101This is the optimal IO size reported by the device. 102 103physical_block_size (RO) 104------------------------ 105This is the physical block size of device, in bytes. 106 107read_ahead_kb (RW) 108------------------ 109Maximum number of kilobytes to read-ahead for filesystems on this block 110device. 111 112rotational (RW) 113--------------- 114This file is used to stat if the device is of rotational type or 115non-rotational type. 116 117rq_affinity (RW) 118---------------- 119If this option is '1', the block layer will migrate request completions to the 120cpu "group" that originally submitted the request. For some workloads this 121provides a significant reduction in CPU cycles due to caching effects. 122 123For storage configurations that need to maximize distribution of completion 124processing setting this option to '2' forces the completion to run on the 125requesting cpu (bypassing the "group" aggregation logic). 126 127scheduler (RW) 128-------------- 129When read, this file will display the current and available IO schedulers 130for this block device. The currently active IO scheduler will be enclosed 131in [] brackets. Writing an IO scheduler name to this file will switch 132control of this block device to that new IO scheduler. Note that writing 133an IO scheduler name to this file will attempt to load that IO scheduler 134module, if it isn't already present in the system. 135 136 137 138Jens Axboe <jens.axboe@oracle.com>, February 2009 139