blob: 2c1e67058fd3bdf02336a71dc34ec885b9b84c2d [file] [log] [blame]
Jens Axboecbb59012009-02-02 13:02:31 +01001Queue 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
Namjae Jeon4004e902012-08-09 15:28:05 +020012add_random (RW)
13----------------
Arnd Hannemanndb4ced12014-08-26 12:33:20 +020014This file allows to turn off the disk entropy contribution. Default
Namjae Jeon4004e902012-08-09 15:28:05 +020015value of this file is '1'(on).
16
Joe Lawrence005411e2016-08-09 14:01:30 -040017dax (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
Namjae Jeon4004e902012-08-09 15:28:05 +020023discard_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
Jens Axboe0034af02015-07-16 09:14:26 -060029discard_max_hw_bytes (RO)
Namjae Jeon4004e902012-08-09 15:28:05 +020030----------------------
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
Jens Axboe0034af02015-07-16 09:14:26 -060038discard_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
Jens Axboecbb59012009-02-02 13:02:31 +010046hw_sector_size (RO)
47-------------------
48This is the hardware sector size of the device, in bytes.
49
Joe Lawrence005411e2016-08-09 14:01:30 -040050io_poll (RW)
51------------
Jeff Moyer71583392017-01-03 17:51:33 -050052When 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.
Joe Lawrence005411e2016-08-09 14:01:30 -040055
Jens Axboe10e62462016-11-17 22:23:02 -070056io_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
67IO to sleep for this amont of microseconds before entering classic
68polling.
69
Namjae Jeon4004e902012-08-09 15:28:05 +020070iostats (RW)
71-------------
72This file is used to control (on/off) the iostats accounting of the
73disk.
74
75logical_block_size (RO)
76-----------------------
Masanari Iida141fd282016-06-29 05:10:57 +090077This is the logical block size of the device, in bytes.
Namjae Jeon4004e902012-08-09 15:28:05 +020078
Jens Axboecbb59012009-02-02 13:02:31 +010079max_hw_sectors_kb (RO)
80----------------------
81This is the maximum number of kilobytes supported in a single data transfer.
82
Namjae Jeon4004e902012-08-09 15:28:05 +020083max_integrity_segments (RO)
84---------------------------
85When read, this file shows the max limit of integrity segments as
86set by block layer which a hardware controller can handle.
87
Jens Axboecbb59012009-02-02 13:02:31 +010088max_sectors_kb (RW)
89-------------------
90This is the maximum number of kilobytes that the block layer will allow
91for a filesystem request. Must be smaller than or equal to the maximum
92size allowed by the hardware.
93
Namjae Jeon4004e902012-08-09 15:28:05 +020094max_segments (RO)
95-----------------
96Maximum number of segments of the device.
97
98max_segment_size (RO)
99---------------------
100Maximum segment size of the device.
101
102minimum_io_size (RO)
103--------------------
Arnd Hannemanndb4ced12014-08-26 12:33:20 +0200104This is the smallest preferred IO size reported by the device.
Namjae Jeon4004e902012-08-09 15:28:05 +0200105
Jens Axboecbb59012009-02-02 13:02:31 +0100106nomerges (RW)
107-------------
Alan D. Brunelle488991e2010-01-29 09:04:08 +0100108This enables the user to disable the lookup logic involved with IO
109merging requests in the block layer. By default (0) all merges are
110enabled. When set to 1 only simple one-hit merges will be tried. When
111set to 2 no merge algorithms will be tried (including one-hit or more
112complex tree/hash lookups).
Jens Axboecbb59012009-02-02 13:02:31 +0100113
114nr_requests (RW)
115----------------
116This controls how many requests may be allocated in the block layer for
117read or write requests. Note that the total allocated number may be twice
118this amount, since it applies only to reads or writes (not the accumulated
119sum).
120
Tejun Heoa0516612012-06-26 15:05:44 -0700121To avoid priority inversion through request starvation, a request
122queue maintains a separate request pool per each cgroup when
123CONFIG_BLK_CGROUP is enabled, and this parameter applies to each such
124per-block-cgroup request pool. IOW, if there are N block cgroups,
Anatol Pomozovf884ab12013-05-08 16:56:16 -0700125each request queue may have up to N request pools, each independently
Tejun Heoa0516612012-06-26 15:05:44 -0700126regulated by nr_requests.
127
Namjae Jeon4004e902012-08-09 15:28:05 +0200128optimal_io_size (RO)
129--------------------
Arnd Hannemanndb4ced12014-08-26 12:33:20 +0200130This is the optimal IO size reported by the device.
Namjae Jeon4004e902012-08-09 15:28:05 +0200131
132physical_block_size (RO)
133------------------------
134This is the physical block size of device, in bytes.
135
Jens Axboecbb59012009-02-02 13:02:31 +0100136read_ahead_kb (RW)
137------------------
138Maximum number of kilobytes to read-ahead for filesystems on this block
139device.
140
Namjae Jeon4004e902012-08-09 15:28:05 +0200141rotational (RW)
142---------------
143This file is used to stat if the device is of rotational type or
144non-rotational type.
145
Jens Axboecbb59012009-02-02 13:02:31 +0100146rq_affinity (RW)
147----------------
Dan Williams5757a6d2011-07-23 20:44:25 +0200148If this option is '1', the block layer will migrate request completions to the
149cpu "group" that originally submitted the request. For some workloads this
150provides a significant reduction in CPU cycles due to caching effects.
151
152For storage configurations that need to maximize distribution of completion
153processing setting this option to '2' forces the completion to run on the
154requesting cpu (bypassing the "group" aggregation logic).
Jens Axboecbb59012009-02-02 13:02:31 +0100155
156scheduler (RW)
157--------------
158When read, this file will display the current and available IO schedulers
159for this block device. The currently active IO scheduler will be enclosed
160in [] brackets. Writing an IO scheduler name to this file will switch
161control of this block device to that new IO scheduler. Note that writing
162an IO scheduler name to this file will attempt to load that IO scheduler
163module, if it isn't already present in the system.
164
Jens Axboe93e9d8e2016-04-12 12:32:46 -0600165write_cache (RW)
166----------------
167When read, this file will display whether the device has write back
168caching enabled or not. It will return "write back" for the former
169case, and "write through" for the latter. Writing to this file can
170change the kernels view of the device, but it doesn't alter the
171device state. This means that it might not be safe to toggle the
172setting from "write back" to "write through", since that will also
173eliminate cache flushes issued by the kernel.
Jens Axboecbb59012009-02-02 13:02:31 +0100174
Joe Lawrence005411e2016-08-09 14:01:30 -0400175write_same_max_bytes (RO)
176-------------------------
177This is the number of bytes the device can write in a single write-same
178command. A value of '0' means write-same is not supported by this
179device.
180
Jens Axboe87760e52016-11-09 12:38:14 -0700181wb_lat_usec (RW)
182----------------
183If the device is registered for writeback throttling, then this file shows
184the target minimum read latency. If this latency is exceeded in a given
185window of time (see wb_window_usec), then the writeback throttling will start
Jens Axboe80e091d2016-11-28 09:22:47 -0700186scaling back writes. Writing a value of '0' to this file disables the
187feature. Writing a value of '-1' to this file resets the value to the
188default setting.
Jens Axboe87760e52016-11-09 12:38:14 -0700189
Shaohua Li297e3d82017-03-27 10:51:37 -0700190throttle_sample_time (RW)
191-------------------------
192This is the time window that blk-throttle samples data, in millisecond.
193blk-throttle makes decision based on the samplings. Lower time means cgroups
194have more smooth throughput, but higher CPU overhead. This exists only when
195CONFIG_BLK_DEV_THROTTLING_LOW is enabled.
Jens Axboecbb59012009-02-02 13:02:31 +0100196
197Jens Axboe <jens.axboe@oracle.com>, February 2009