Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
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
12add_random (RW)
13----------------
14This file allows to turn off the disk entropy contribution. Default
15value of this file is '1'(on).
16
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
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
29discard_max_hw_bytes (RO)
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
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
46discard_zeroes_data (RO)
47------------------------
48When read, this file will show if the discarded block are zeroed by the
49device or not. If its value is '1' the blocks are zeroed otherwise not.
50
51hw_sector_size (RO)
52-------------------
53This is the hardware sector size of the device, in bytes.
54
55io_poll (RW)
56------------
57When read, this file shows the total number of block IO polls and how
58many returned success. Writing '0' to this file will disable polling
59for this device. Writing any non-zero value will enable this feature.
60
61io_poll_delay (RW)
62------------------
63If polling is enabled, this controls what kind of polling will be
64performed. It defaults to -1, which is classic polling. In this mode,
65the CPU will repeatedly ask for completions without giving up any time.
66If set to 0, a hybrid polling mode is used, where the kernel will attempt
67to make an educated guess at when the IO will complete. Based on this
68guess, the kernel will put the process issuing IO to sleep for an amount
69of time, before entering a classic poll loop. This mode might be a
70little slower than pure classic polling, but it will be more efficient.
71If set to a value larger than 0, the kernel will put the process issuing
72IO to sleep for this amont of microseconds before entering classic
73polling.
74
75iostats (RW)
76-------------
77This file is used to control (on/off) the iostats accounting of the
78disk.
79
80logical_block_size (RO)
81-----------------------
82This is the logical block size of the device, in bytes.
83
84max_hw_sectors_kb (RO)
85----------------------
86This is the maximum number of kilobytes supported in a single data transfer.
87
88max_integrity_segments (RO)
89---------------------------
90When read, this file shows the max limit of integrity segments as
91set by block layer which a hardware controller can handle.
92
93max_sectors_kb (RW)
94-------------------
95This is the maximum number of kilobytes that the block layer will allow
96for a filesystem request. Must be smaller than or equal to the maximum
97size allowed by the hardware.
98
99max_segments (RO)
100-----------------
101Maximum number of segments of the device.
102
103max_segment_size (RO)
104---------------------
105Maximum segment size of the device.
106
107minimum_io_size (RO)
108--------------------
109This is the smallest preferred IO size reported by the device.
110
111nomerges (RW)
112-------------
113This enables the user to disable the lookup logic involved with IO
114merging requests in the block layer. By default (0) all merges are
115enabled. When set to 1 only simple one-hit merges will be tried. When
116set to 2 no merge algorithms will be tried (including one-hit or more
117complex tree/hash lookups).
118
119nr_requests (RW)
120----------------
121This controls how many requests may be allocated in the block layer for
122read or write requests. Note that the total allocated number may be twice
123this amount, since it applies only to reads or writes (not the accumulated
124sum).
125
126To avoid priority inversion through request starvation, a request
127queue maintains a separate request pool per each cgroup when
128CONFIG_BLK_CGROUP is enabled, and this parameter applies to each such
129per-block-cgroup request pool. IOW, if there are N block cgroups,
130each request queue may have up to N request pools, each independently
131regulated by nr_requests.
132
133optimal_io_size (RO)
134--------------------
135This is the optimal IO size reported by the device.
136
137physical_block_size (RO)
138------------------------
139This is the physical block size of device, in bytes.
140
141read_ahead_kb (RW)
142------------------
143Maximum number of kilobytes to read-ahead for filesystems on this block
144device.
145
146rotational (RW)
147---------------
148This file is used to stat if the device is of rotational type or
149non-rotational type.
150
151rq_affinity (RW)
152----------------
153If this option is '1', the block layer will migrate request completions to the
154cpu "group" that originally submitted the request. For some workloads this
155provides a significant reduction in CPU cycles due to caching effects.
156
157For storage configurations that need to maximize distribution of completion
158processing setting this option to '2' forces the completion to run on the
159requesting cpu (bypassing the "group" aggregation logic).
160
161scheduler (RW)
162--------------
163When read, this file will display the current and available IO schedulers
164for this block device. The currently active IO scheduler will be enclosed
165in [] brackets. Writing an IO scheduler name to this file will switch
166control of this block device to that new IO scheduler. Note that writing
167an IO scheduler name to this file will attempt to load that IO scheduler
168module, if it isn't already present in the system.
169
170write_cache (RW)
171----------------
172When read, this file will display whether the device has write back
173caching enabled or not. It will return "write back" for the former
174case, and "write through" for the latter. Writing to this file can
175change the kernels view of the device, but it doesn't alter the
176device state. This means that it might not be safe to toggle the
177setting from "write back" to "write through", since that will also
178eliminate cache flushes issued by the kernel.
179
180write_same_max_bytes (RO)
181-------------------------
182This is the number of bytes the device can write in a single write-same
183command. A value of '0' means write-same is not supported by this
184device.
185
186wb_lat_usec (RW)
187----------------
188If the device is registered for writeback throttling, then this file shows
189the target minimum read latency. If this latency is exceeded in a given
190window of time (see wb_window_usec), then the writeback throttling will start
191scaling back writes. Writing a value of '0' to this file disables the
192feature. Writing a value of '-1' to this file resets the value to the
193default setting.
194
195
196Jens Axboe <jens.axboe@oracle.com>, February 2009