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