]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/blame - Documentation/block/queue-sysfs.txt
Merge tag 'sh-pfc-for-v5.1-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git...
[mirror_ubuntu-focal-kernel.git] / Documentation / block / queue-sysfs.txt
CommitLineData
cbb5901b
JA
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
4004e90c
NJ
12add_random (RW)
13----------------
db4ced14 14This file allows to turn off the disk entropy contribution. Default
4004e90c
NJ
15value of this file is '1'(on).
16
005411ea
JL
17dax (RO)
18--------
19This file indicates whether the device supports Direct Access (DAX),
20used by CPU-addressable storage to bypass the pagecache. It shows '1'
21if true, '0' if not.
22
4004e90c
NJ
23discard_granularity (RO)
24-----------------------
25This shows the size of internal allocation of the device in bytes, if
26reported by the device. A value of '0' means device does not support
27the discard functionality.
28
0034af03 29discard_max_hw_bytes (RO)
4004e90c
NJ
30----------------------
31Devices that support discard functionality may have internal limits on
32the number of bytes that can be trimmed or unmapped in a single operation.
33The discard_max_bytes parameter is set by the device driver to the maximum
34number of bytes that can be discarded in a single operation. Discard
35requests issued to the device must not exceed this limit. A discard_max_bytes
36value of 0 means that the device does not support discard functionality.
37
0034af03
JA
38discard_max_bytes (RW)
39----------------------
40While discard_max_hw_bytes is the hardware limit for the device, this
41setting is the software limit. Some devices exhibit large latencies when
42large discards are issued, setting this value lower will make Linux issue
43smaller discards and potentially help reduce latencies induced by large
44discard operations.
45
cbb5901b
JA
46hw_sector_size (RO)
47-------------------
48This is the hardware sector size of the device, in bytes.
49
005411ea
JL
50io_poll (RW)
51------------
7158339d
JM
52When read, this file shows whether polling is enabled (1) or disabled
53(0). Writing '0' to this file will disable polling for this device.
54Writing any non-zero value will enable this feature.
005411ea 55
10e6246e
JA
56io_poll_delay (RW)
57------------------
58If polling is enabled, this controls what kind of polling will be
59performed. It defaults to -1, which is classic polling. In this mode,
60the CPU will repeatedly ask for completions without giving up any time.
61If set to 0, a hybrid polling mode is used, where the kernel will attempt
62to make an educated guess at when the IO will complete. Based on this
63guess, the kernel will put the process issuing IO to sleep for an amount
64of time, before entering a classic poll loop. This mode might be a
65little slower than pure classic polling, but it will be more efficient.
66If set to a value larger than 0, the kernel will put the process issuing
f9824952 67IO to sleep for this amount of microseconds before entering classic
10e6246e
JA
68polling.
69
bb351aba
WZ
70io_timeout (RW)
71---------------
72io_timeout is the request timeout in milliseconds. If a request does not
73complete in this time then the block driver timeout handler is invoked.
74That timeout handler can decide to retry the request, to fail it or to start
75a device recovery strategy.
76
4004e90c
NJ
77iostats (RW)
78-------------
79This file is used to control (on/off) the iostats accounting of the
80disk.
81
82logical_block_size (RO)
83-----------------------
141fd28c 84This is the logical block size of the device, in bytes.
4004e90c 85
cbb5901b
JA
86max_hw_sectors_kb (RO)
87----------------------
88This is the maximum number of kilobytes supported in a single data transfer.
89
4004e90c
NJ
90max_integrity_segments (RO)
91---------------------------
92When read, this file shows the max limit of integrity segments as
93set by block layer which a hardware controller can handle.
94
cbb5901b
JA
95max_sectors_kb (RW)
96-------------------
97This is the maximum number of kilobytes that the block layer will allow
98for a filesystem request. Must be smaller than or equal to the maximum
99size allowed by the hardware.
100
4004e90c
NJ
101max_segments (RO)
102-----------------
103Maximum number of segments of the device.
104
105max_segment_size (RO)
106---------------------
107Maximum segment size of the device.
108
109minimum_io_size (RO)
110--------------------
db4ced14 111This is the smallest preferred IO size reported by the device.
4004e90c 112
cbb5901b
JA
113nomerges (RW)
114-------------
488991e2
AB
115This enables the user to disable the lookup logic involved with IO
116merging requests in the block layer. By default (0) all merges are
117enabled. When set to 1 only simple one-hit merges will be tried. When
118set to 2 no merge algorithms will be tried (including one-hit or more
119complex tree/hash lookups).
cbb5901b
JA
120
121nr_requests (RW)
122----------------
123This controls how many requests may be allocated in the block layer for
124read or write requests. Note that the total allocated number may be twice
125this amount, since it applies only to reads or writes (not the accumulated
126sum).
127
a051661c
TH
128To avoid priority inversion through request starvation, a request
129queue maintains a separate request pool per each cgroup when
130CONFIG_BLK_CGROUP is enabled, and this parameter applies to each such
131per-block-cgroup request pool. IOW, if there are N block cgroups,
f884ab15 132each request queue may have up to N request pools, each independently
a051661c
TH
133regulated by nr_requests.
134
4004e90c
NJ
135optimal_io_size (RO)
136--------------------
db4ced14 137This is the optimal IO size reported by the device.
4004e90c
NJ
138
139physical_block_size (RO)
140------------------------
141This is the physical block size of device, in bytes.
142
cbb5901b
JA
143read_ahead_kb (RW)
144------------------
145Maximum number of kilobytes to read-ahead for filesystems on this block
146device.
147
4004e90c
NJ
148rotational (RW)
149---------------
150This file is used to stat if the device is of rotational type or
151non-rotational type.
152
cbb5901b
JA
153rq_affinity (RW)
154----------------
5757a6d7
DW
155If this option is '1', the block layer will migrate request completions to the
156cpu "group" that originally submitted the request. For some workloads this
157provides a significant reduction in CPU cycles due to caching effects.
158
159For storage configurations that need to maximize distribution of completion
160processing setting this option to '2' forces the completion to run on the
161requesting cpu (bypassing the "group" aggregation logic).
cbb5901b
JA
162
163scheduler (RW)
164--------------
165When read, this file will display the current and available IO schedulers
166for this block device. The currently active IO scheduler will be enclosed
167in [] brackets. Writing an IO scheduler name to this file will switch
168control of this block device to that new IO scheduler. Note that writing
169an IO scheduler name to this file will attempt to load that IO scheduler
170module, if it isn't already present in the system.
171
93e9d8e8
JA
172write_cache (RW)
173----------------
174When read, this file will display whether the device has write back
175caching enabled or not. It will return "write back" for the former
176case, and "write through" for the latter. Writing to this file can
177change the kernels view of the device, but it doesn't alter the
178device state. This means that it might not be safe to toggle the
179setting from "write back" to "write through", since that will also
180eliminate cache flushes issued by the kernel.
cbb5901b 181
005411ea
JL
182write_same_max_bytes (RO)
183-------------------------
184This is the number of bytes the device can write in a single write-same
185command. A value of '0' means write-same is not supported by this
186device.
187
87760e5e
JA
188wb_lat_usec (RW)
189----------------
190If the device is registered for writeback throttling, then this file shows
191the target minimum read latency. If this latency is exceeded in a given
192window of time (see wb_window_usec), then the writeback throttling will start
80e091d1
JA
193scaling back writes. Writing a value of '0' to this file disables the
194feature. Writing a value of '-1' to this file resets the value to the
195default setting.
87760e5e 196
297e3d85
SL
197throttle_sample_time (RW)
198-------------------------
199This is the time window that blk-throttle samples data, in millisecond.
200blk-throttle makes decision based on the samplings. Lower time means cgroups
201have more smooth throughput, but higher CPU overhead. This exists only when
202CONFIG_BLK_DEV_THROTTLING_LOW is enabled.
cbb5901b 203
f9824952
DLM
204zoned (RO)
205----------
206This indicates if the device is a zoned block device and the zone model of the
207device 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
209block devices. The characteristics of host-aware and host-managed zoned block
210devices 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
213do not support zone commands, they will be treated as regular block devices
214and zoned will report "none".
215
216nr_zones (RO)
217-------------
218For zoned block devices (zoned attribute indicating "host-managed" or
219"host-aware"), this indicates the total number of zones of the device.
220This is always 0 for regular block devices.
221
222chunk_sectors (RO)
223------------------
224This has different meaning depending on the type of the block device.
225For a RAID device (dm-raid), chunk_sectors indicates the size in 512B sectors
226of the RAID volume stripe segment. For a zoned block device, either host-aware
227or host-managed, chunk_sectors indicates the size in 512B sectors of the zones
228of the device, with the eventual exception of the last zone of the device which
229may be smaller.
230
cbb5901b 231Jens Axboe <jens.axboe@oracle.com>, February 2009