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