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