blob: 4dc7f0d499a8454f08f6d2187ced4f6482353721 [file] [log] [blame]
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -03001=================
Jens Axboecbb59012009-02-02 13:02:31 +01002Queue 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
Namjae Jeon4004e902012-08-09 15:28:05 +020013add_random (RW)
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -030014---------------
Arnd Hannemanndb4ced12014-08-26 12:33:20 +020015This file allows to turn off the disk entropy contribution. Default
Namjae Jeon4004e902012-08-09 15:28:05 +020016value of this file is '1'(on).
17
Bart Van Assche6728ac32019-06-28 13:07:43 -070018chunk_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
Joe Lawrence005411e2016-08-09 14:01:30 -040027dax (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
Namjae Jeon4004e902012-08-09 15:28:05 +020033discard_granularity (RO)
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -030034------------------------
Namjae Jeon4004e902012-08-09 15:28:05 +020035This 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
Jens Axboe0034af02015-07-16 09:14:26 -060039discard_max_hw_bytes (RO)
Mauro Carvalho Chehab898bd372019-04-18 19:45:00 -030040-------------------------
Namjae Jeon4004e902012-08-09 15:28:05 +020041Devices 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
Jens Axboe0034af02015-07-16 09:14:26 -060048discard_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
Bart Van Asschefbbe7c82019-06-28 13:07:45 -070056discard_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
Jens Axboecbb59012009-02-02 13:02:31 +010066hw_sector_size (RO)
67-------------------
68This is the hardware sector size of the device, in bytes.
69
Joe Lawrence005411e2016-08-09 14:01:30 -040070io_poll (RW)
71------------
Jeff Moyer71583392017-01-03 17:51:33 -050072When 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.
Joe Lawrence005411e2016-08-09 14:01:30 -040075
Jens Axboe10e62462016-11-17 22:23:02 -070076io_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
Damien Le Moalf9824952018-11-30 14:36:24 +090087IO to sleep for this amount of microseconds before entering classic
Jens Axboe10e62462016-11-17 22:23:02 -070088polling.
89
Weiping Zhangbb351ab2018-12-26 11:56:33 +080090io_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
Namjae Jeon4004e902012-08-09 15:28:05 +020097iostats (RW)
98-------------
99This file is used to control (on/off) the iostats accounting of the
100disk.
101
102logical_block_size (RO)
103-----------------------
Masanari Iida141fd282016-06-29 05:10:57 +0900104This is the logical block size of the device, in bytes.
Namjae Jeon4004e902012-08-09 15:28:05 +0200105
Bart Van Asschefbbe7c82019-06-28 13:07:45 -0700106max_discard_segments (RO)
107-------------------------
108The maximum number of DMA scatter/gather entries in a discard request.
109
Jens Axboecbb59012009-02-02 13:02:31 +0100110max_hw_sectors_kb (RO)
111----------------------
112This is the maximum number of kilobytes supported in a single data transfer.
113
Namjae Jeon4004e902012-08-09 15:28:05 +0200114max_integrity_segments (RO)
115---------------------------
Bart Van Assche0c766e72019-06-28 13:07:44 -0700116Maximum 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.
Namjae Jeon4004e902012-08-09 15:28:05 +0200119
Niklas Cassel659bf822020-07-14 23:18:24 +0200120max_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
Keith Busch3b481d92020-09-24 13:53:28 -0700127If the host attempts to exceed this limit, the driver should report this error
128with BLK_STS_ZONE_ACTIVE_RESOURCE, which user space may see as the EOVERFLOW
129errno.
130
Niklas Cassele15864f2020-07-14 23:18:23 +0200131max_open_zones (RO)
132-------------------
133For zoned block devices (zoned attribute indicating "host-managed" or
134"host-aware"), the sum of zones belonging to any of the zone states:
135EXPLICIT OPEN or IMPLICIT OPEN, is limited by this value.
136If this value is 0, there is no limit.
137
Keith Busch3b481d92020-09-24 13:53:28 -0700138If the host attempts to exceed this limit, the driver should report this error
139with BLK_STS_ZONE_OPEN_RESOURCE, which user space may see as the ETOOMANYREFS
140errno.
141
Jens Axboecbb59012009-02-02 13:02:31 +0100142max_sectors_kb (RW)
143-------------------
144This is the maximum number of kilobytes that the block layer will allow
145for a filesystem request. Must be smaller than or equal to the maximum
146size allowed by the hardware.
147
Namjae Jeon4004e902012-08-09 15:28:05 +0200148max_segments (RO)
149-----------------
Bart Van Assche0c766e72019-06-28 13:07:44 -0700150Maximum number of elements in a DMA scatter/gather list that is submitted
151to the associated block driver.
Namjae Jeon4004e902012-08-09 15:28:05 +0200152
153max_segment_size (RO)
154---------------------
Bart Van Assche0c766e72019-06-28 13:07:44 -0700155Maximum size in bytes of a single element in a DMA scatter/gather list.
Namjae Jeon4004e902012-08-09 15:28:05 +0200156
157minimum_io_size (RO)
158--------------------
Arnd Hannemanndb4ced12014-08-26 12:33:20 +0200159This is the smallest preferred IO size reported by the device.
Namjae Jeon4004e902012-08-09 15:28:05 +0200160
Jens Axboecbb59012009-02-02 13:02:31 +0100161nomerges (RW)
162-------------
Alan D. Brunelle488991e2010-01-29 09:04:08 +0100163This enables the user to disable the lookup logic involved with IO
164merging requests in the block layer. By default (0) all merges are
165enabled. When set to 1 only simple one-hit merges will be tried. When
166set to 2 no merge algorithms will be tried (including one-hit or more
167complex tree/hash lookups).
Jens Axboecbb59012009-02-02 13:02:31 +0100168
169nr_requests (RW)
170----------------
171This controls how many requests may be allocated in the block layer for
172read or write requests. Note that the total allocated number may be twice
173this amount, since it applies only to reads or writes (not the accumulated
174sum).
175
Tejun Heoa0516612012-06-26 15:05:44 -0700176To avoid priority inversion through request starvation, a request
177queue maintains a separate request pool per each cgroup when
178CONFIG_BLK_CGROUP is enabled, and this parameter applies to each such
179per-block-cgroup request pool. IOW, if there are N block cgroups,
Anatol Pomozovf884ab12013-05-08 16:56:16 -0700180each request queue may have up to N request pools, each independently
Tejun Heoa0516612012-06-26 15:05:44 -0700181regulated by nr_requests.
182
Bart Van Assche6728ac32019-06-28 13:07:43 -0700183nr_zones (RO)
184-------------
185For zoned block devices (zoned attribute indicating "host-managed" or
186"host-aware"), this indicates the total number of zones of the device.
187This is always 0 for regular block devices.
188
Namjae Jeon4004e902012-08-09 15:28:05 +0200189optimal_io_size (RO)
190--------------------
Arnd Hannemanndb4ced12014-08-26 12:33:20 +0200191This is the optimal IO size reported by the device.
Namjae Jeon4004e902012-08-09 15:28:05 +0200192
193physical_block_size (RO)
194------------------------
195This is the physical block size of device, in bytes.
196
Jens Axboecbb59012009-02-02 13:02:31 +0100197read_ahead_kb (RW)
198------------------
199Maximum number of kilobytes to read-ahead for filesystems on this block
200device.
201
Namjae Jeon4004e902012-08-09 15:28:05 +0200202rotational (RW)
203---------------
204This file is used to stat if the device is of rotational type or
205non-rotational type.
206
Jens Axboecbb59012009-02-02 13:02:31 +0100207rq_affinity (RW)
208----------------
Dan Williams5757a6d2011-07-23 20:44:25 +0200209If this option is '1', the block layer will migrate request completions to the
210cpu "group" that originally submitted the request. For some workloads this
211provides a significant reduction in CPU cycles due to caching effects.
212
213For storage configurations that need to maximize distribution of completion
214processing setting this option to '2' forces the completion to run on the
215requesting cpu (bypassing the "group" aggregation logic).
Jens Axboecbb59012009-02-02 13:02:31 +0100216
217scheduler (RW)
218--------------
219When read, this file will display the current and available IO schedulers
220for this block device. The currently active IO scheduler will be enclosed
221in [] brackets. Writing an IO scheduler name to this file will switch
222control of this block device to that new IO scheduler. Note that writing
223an IO scheduler name to this file will attempt to load that IO scheduler
224module, if it isn't already present in the system.
225
Jens Axboe93e9d8e2016-04-12 12:32:46 -0600226write_cache (RW)
227----------------
228When read, this file will display whether the device has write back
229caching enabled or not. It will return "write back" for the former
230case, and "write through" for the latter. Writing to this file can
231change the kernels view of the device, but it doesn't alter the
232device state. This means that it might not be safe to toggle the
233setting from "write back" to "write through", since that will also
234eliminate cache flushes issued by the kernel.
Jens Axboecbb59012009-02-02 13:02:31 +0100235
Joe Lawrence005411e2016-08-09 14:01:30 -0400236write_same_max_bytes (RO)
237-------------------------
238This is the number of bytes the device can write in a single write-same
239command. A value of '0' means write-same is not supported by this
240device.
241
Bart Van Assche152c7772019-06-28 13:07:42 -0700242wbt_lat_usec (RW)
243-----------------
Jens Axboe87760e52016-11-09 12:38:14 -0700244If the device is registered for writeback throttling, then this file shows
245the target minimum read latency. If this latency is exceeded in a given
246window of time (see wb_window_usec), then the writeback throttling will start
Jens Axboe80e091d2016-11-28 09:22:47 -0700247scaling back writes. Writing a value of '0' to this file disables the
248feature. Writing a value of '-1' to this file resets the value to the
249default setting.
Jens Axboe87760e52016-11-09 12:38:14 -0700250
Shaohua Li297e3d82017-03-27 10:51:37 -0700251throttle_sample_time (RW)
252-------------------------
253This is the time window that blk-throttle samples data, in millisecond.
254blk-throttle makes decision based on the samplings. Lower time means cgroups
255have more smooth throughput, but higher CPU overhead. This exists only when
256CONFIG_BLK_DEV_THROTTLING_LOW is enabled.
Jens Axboecbb59012009-02-02 13:02:31 +0100257
Bart Van Asschefbbe7c82019-06-28 13:07:45 -0700258write_zeroes_max_bytes (RO)
259---------------------------
260For block drivers that support REQ_OP_WRITE_ZEROES, the maximum number of
261bytes that can be zeroed at once. The value 0 means that REQ_OP_WRITE_ZEROES
262is not supported.
263
Damien Le Moalf1836422021-01-28 13:47:26 +0900264zone_append_max_bytes (RO)
265--------------------------
266This is the maximum number of bytes that can be written to a sequential
267zone 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
Damien Le Moalf9824952018-11-30 14:36:24 +0900270zoned (RO)
271----------
272This indicates if the device is a zoned block device and the zone model of the
273device 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
275block devices. The characteristics of host-aware and host-managed zoned block
276devices 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
279do not support zone commands, they will be treated as regular block devices
280and zoned will report "none".
281
Damien Le Moala805a4f2021-01-28 13:47:30 +0900282zone_write_granularity (RO)
283---------------------------
284This indicates the alignment constraint, in bytes, for write operations in
285sequential zones of zoned block devices (devices with a zoned attributed
286that reports "host-managed" or "host-aware"). This value is always 0 for
287regular block devices.
288
Jens Axboecbb59012009-02-02 13:02:31 +0100289Jens Axboe <jens.axboe@oracle.com>, February 2009