at v5.9-rc2 268 lines 11 kB view raw
1================= 2Queue sysfs files 3================= 4 5This text file will detail the queue files that are located in the sysfs tree 6for each block device. Note that stacked devices typically do not export 7any settings, since their queue merely functions are a remapping target. 8These files are the ones found in the /sys/block/xxx/queue/ directory. 9 10Files denoted with a RO postfix are readonly and the RW postfix means 11read-write. 12 13add_random (RW) 14--------------- 15This file allows to turn off the disk entropy contribution. Default 16value of this file is '1'(on). 17 18chunk_sectors (RO) 19------------------ 20This has different meaning depending on the type of the block device. 21For a RAID device (dm-raid), chunk_sectors indicates the size in 512B sectors 22of the RAID volume stripe segment. For a zoned block device, either host-aware 23or host-managed, chunk_sectors indicates the size in 512B sectors of the zones 24of the device, with the eventual exception of the last zone of the device which 25may be smaller. 26 27dax (RO) 28-------- 29This file indicates whether the device supports Direct Access (DAX), 30used by CPU-addressable storage to bypass the pagecache. It shows '1' 31if true, '0' if not. 32 33discard_granularity (RO) 34------------------------ 35This shows the size of internal allocation of the device in bytes, if 36reported by the device. A value of '0' means device does not support 37the discard functionality. 38 39discard_max_hw_bytes (RO) 40------------------------- 41Devices that support discard functionality may have internal limits on 42the number of bytes that can be trimmed or unmapped in a single operation. 43The discard_max_bytes parameter is set by the device driver to the maximum 44number of bytes that can be discarded in a single operation. Discard 45requests issued to the device must not exceed this limit. A discard_max_bytes 46value of 0 means that the device does not support discard functionality. 47 48discard_max_bytes (RW) 49---------------------- 50While discard_max_hw_bytes is the hardware limit for the device, this 51setting is the software limit. Some devices exhibit large latencies when 52large discards are issued, setting this value lower will make Linux issue 53smaller discards and potentially help reduce latencies induced by large 54discard operations. 55 56discard_zeroes_data (RO) 57------------------------ 58Obsolete. Always zero. 59 60fua (RO) 61-------- 62Whether or not the block driver supports the FUA flag for write requests. 63FUA stands for Force Unit Access. If the FUA flag is set that means that 64write requests must bypass the volatile cache of the storage device. 65 66hw_sector_size (RO) 67------------------- 68This is the hardware sector size of the device, in bytes. 69 70io_poll (RW) 71------------ 72When read, this file shows whether polling is enabled (1) or disabled 73(0). Writing '0' to this file will disable polling for this device. 74Writing any non-zero value will enable this feature. 75 76io_poll_delay (RW) 77------------------ 78If polling is enabled, this controls what kind of polling will be 79performed. It defaults to -1, which is classic polling. In this mode, 80the CPU will repeatedly ask for completions without giving up any time. 81If set to 0, a hybrid polling mode is used, where the kernel will attempt 82to make an educated guess at when the IO will complete. Based on this 83guess, the kernel will put the process issuing IO to sleep for an amount 84of time, before entering a classic poll loop. This mode might be a 85little slower than pure classic polling, but it will be more efficient. 86If set to a value larger than 0, the kernel will put the process issuing 87IO to sleep for this amount of microseconds before entering classic 88polling. 89 90io_timeout (RW) 91--------------- 92io_timeout is the request timeout in milliseconds. If a request does not 93complete in this time then the block driver timeout handler is invoked. 94That timeout handler can decide to retry the request, to fail it or to start 95a device recovery strategy. 96 97iostats (RW) 98------------- 99This file is used to control (on/off) the iostats accounting of the 100disk. 101 102logical_block_size (RO) 103----------------------- 104This is the logical block size of the device, in bytes. 105 106max_discard_segments (RO) 107------------------------- 108The maximum number of DMA scatter/gather entries in a discard request. 109 110max_hw_sectors_kb (RO) 111---------------------- 112This is the maximum number of kilobytes supported in a single data transfer. 113 114max_integrity_segments (RO) 115--------------------------- 116Maximum number of elements in a DMA scatter/gather list with integrity 117data that will be submitted by the block layer core to the associated 118block driver. 119 120max_active_zones (RO) 121--------------------- 122For zoned block devices (zoned attribute indicating "host-managed" or 123"host-aware"), the sum of zones belonging to any of the zone states: 124EXPLICIT OPEN, IMPLICIT OPEN or CLOSED, is limited by this value. 125If this value is 0, there is no limit. 126 127max_open_zones (RO) 128------------------- 129For zoned block devices (zoned attribute indicating "host-managed" or 130"host-aware"), the sum of zones belonging to any of the zone states: 131EXPLICIT OPEN or IMPLICIT OPEN, is limited by this value. 132If this value is 0, there is no limit. 133 134max_sectors_kb (RW) 135------------------- 136This is the maximum number of kilobytes that the block layer will allow 137for a filesystem request. Must be smaller than or equal to the maximum 138size allowed by the hardware. 139 140max_segments (RO) 141----------------- 142Maximum number of elements in a DMA scatter/gather list that is submitted 143to the associated block driver. 144 145max_segment_size (RO) 146--------------------- 147Maximum size in bytes of a single element in a DMA scatter/gather list. 148 149minimum_io_size (RO) 150-------------------- 151This is the smallest preferred IO size reported by the device. 152 153nomerges (RW) 154------------- 155This enables the user to disable the lookup logic involved with IO 156merging requests in the block layer. By default (0) all merges are 157enabled. When set to 1 only simple one-hit merges will be tried. When 158set to 2 no merge algorithms will be tried (including one-hit or more 159complex tree/hash lookups). 160 161nr_requests (RW) 162---------------- 163This controls how many requests may be allocated in the block layer for 164read or write requests. Note that the total allocated number may be twice 165this amount, since it applies only to reads or writes (not the accumulated 166sum). 167 168To avoid priority inversion through request starvation, a request 169queue maintains a separate request pool per each cgroup when 170CONFIG_BLK_CGROUP is enabled, and this parameter applies to each such 171per-block-cgroup request pool. IOW, if there are N block cgroups, 172each request queue may have up to N request pools, each independently 173regulated by nr_requests. 174 175nr_zones (RO) 176------------- 177For zoned block devices (zoned attribute indicating "host-managed" or 178"host-aware"), this indicates the total number of zones of the device. 179This is always 0 for regular block devices. 180 181optimal_io_size (RO) 182-------------------- 183This is the optimal IO size reported by the device. 184 185physical_block_size (RO) 186------------------------ 187This is the physical block size of device, in bytes. 188 189read_ahead_kb (RW) 190------------------ 191Maximum number of kilobytes to read-ahead for filesystems on this block 192device. 193 194rotational (RW) 195--------------- 196This file is used to stat if the device is of rotational type or 197non-rotational type. 198 199rq_affinity (RW) 200---------------- 201If this option is '1', the block layer will migrate request completions to the 202cpu "group" that originally submitted the request. For some workloads this 203provides a significant reduction in CPU cycles due to caching effects. 204 205For storage configurations that need to maximize distribution of completion 206processing setting this option to '2' forces the completion to run on the 207requesting cpu (bypassing the "group" aggregation logic). 208 209scheduler (RW) 210-------------- 211When read, this file will display the current and available IO schedulers 212for this block device. The currently active IO scheduler will be enclosed 213in [] brackets. Writing an IO scheduler name to this file will switch 214control of this block device to that new IO scheduler. Note that writing 215an IO scheduler name to this file will attempt to load that IO scheduler 216module, if it isn't already present in the system. 217 218write_cache (RW) 219---------------- 220When read, this file will display whether the device has write back 221caching enabled or not. It will return "write back" for the former 222case, and "write through" for the latter. Writing to this file can 223change the kernels view of the device, but it doesn't alter the 224device state. This means that it might not be safe to toggle the 225setting from "write back" to "write through", since that will also 226eliminate cache flushes issued by the kernel. 227 228write_same_max_bytes (RO) 229------------------------- 230This is the number of bytes the device can write in a single write-same 231command. A value of '0' means write-same is not supported by this 232device. 233 234wbt_lat_usec (RW) 235----------------- 236If the device is registered for writeback throttling, then this file shows 237the target minimum read latency. If this latency is exceeded in a given 238window of time (see wb_window_usec), then the writeback throttling will start 239scaling back writes. Writing a value of '0' to this file disables the 240feature. Writing a value of '-1' to this file resets the value to the 241default setting. 242 243throttle_sample_time (RW) 244------------------------- 245This is the time window that blk-throttle samples data, in millisecond. 246blk-throttle makes decision based on the samplings. Lower time means cgroups 247have more smooth throughput, but higher CPU overhead. This exists only when 248CONFIG_BLK_DEV_THROTTLING_LOW is enabled. 249 250write_zeroes_max_bytes (RO) 251--------------------------- 252For block drivers that support REQ_OP_WRITE_ZEROES, the maximum number of 253bytes that can be zeroed at once. The value 0 means that REQ_OP_WRITE_ZEROES 254is not supported. 255 256zoned (RO) 257---------- 258This indicates if the device is a zoned block device and the zone model of the 259device if it is indeed zoned. The possible values indicated by zoned are 260"none" for regular block devices and "host-aware" or "host-managed" for zoned 261block devices. The characteristics of host-aware and host-managed zoned block 262devices are described in the ZBC (Zoned Block Commands) and ZAC 263(Zoned Device ATA Command Set) standards. These standards also define the 264"drive-managed" zone model. However, since drive-managed zoned block devices 265do not support zone commands, they will be treated as regular block devices 266and zoned will report "none". 267 268Jens Axboe <jens.axboe@oracle.com>, February 2009