Merge tag 'tegra-for-4.8-i2c' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra...
[cascardo/linux.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 the total number of block IO polls and how
58 many returned success.  Writing '0' to this file will disable polling
59 for this device.  Writing any non-zero value will enable this feature.
60
61 iostats (RW)
62 -------------
63 This file is used to control (on/off) the iostats accounting of the
64 disk.
65
66 logical_block_size (RO)
67 -----------------------
68 This is the logical block size of the device, in bytes.
69
70 max_hw_sectors_kb (RO)
71 ----------------------
72 This is the maximum number of kilobytes supported in a single data transfer.
73
74 max_integrity_segments (RO)
75 ---------------------------
76 When read, this file shows the max limit of integrity segments as
77 set by block layer which a hardware controller can handle.
78
79 max_sectors_kb (RW)
80 -------------------
81 This is the maximum number of kilobytes that the block layer will allow
82 for a filesystem request. Must be smaller than or equal to the maximum
83 size allowed by the hardware.
84
85 max_segments (RO)
86 -----------------
87 Maximum number of segments of the device.
88
89 max_segment_size (RO)
90 ---------------------
91 Maximum segment size of the device.
92
93 minimum_io_size (RO)
94 --------------------
95 This is the smallest preferred IO size reported by the device.
96
97 nomerges (RW)
98 -------------
99 This enables the user to disable the lookup logic involved with IO
100 merging requests in the block layer. By default (0) all merges are
101 enabled. When set to 1 only simple one-hit merges will be tried. When
102 set to 2 no merge algorithms will be tried (including one-hit or more
103 complex tree/hash lookups).
104
105 nr_requests (RW)
106 ----------------
107 This controls how many requests may be allocated in the block layer for
108 read or write requests. Note that the total allocated number may be twice
109 this amount, since it applies only to reads or writes (not the accumulated
110 sum).
111
112 To avoid priority inversion through request starvation, a request
113 queue maintains a separate request pool per each cgroup when
114 CONFIG_BLK_CGROUP is enabled, and this parameter applies to each such
115 per-block-cgroup request pool.  IOW, if there are N block cgroups,
116 each request queue may have up to N request pools, each independently
117 regulated by nr_requests.
118
119 optimal_io_size (RO)
120 --------------------
121 This is the optimal IO size reported by the device.
122
123 physical_block_size (RO)
124 ------------------------
125 This is the physical block size of device, in bytes.
126
127 read_ahead_kb (RW)
128 ------------------
129 Maximum number of kilobytes to read-ahead for filesystems on this block
130 device.
131
132 rotational (RW)
133 ---------------
134 This file is used to stat if the device is of rotational type or
135 non-rotational type.
136
137 rq_affinity (RW)
138 ----------------
139 If this option is '1', the block layer will migrate request completions to the
140 cpu "group" that originally submitted the request. For some workloads this
141 provides a significant reduction in CPU cycles due to caching effects.
142
143 For storage configurations that need to maximize distribution of completion
144 processing setting this option to '2' forces the completion to run on the
145 requesting cpu (bypassing the "group" aggregation logic).
146
147 scheduler (RW)
148 --------------
149 When read, this file will display the current and available IO schedulers
150 for this block device. The currently active IO scheduler will be enclosed
151 in [] brackets. Writing an IO scheduler name to this file will switch
152 control of this block device to that new IO scheduler. Note that writing
153 an IO scheduler name to this file will attempt to load that IO scheduler
154 module, if it isn't already present in the system.
155
156 write_cache (RW)
157 ----------------
158 When read, this file will display whether the device has write back
159 caching enabled or not. It will return "write back" for the former
160 case, and "write through" for the latter. Writing to this file can
161 change the kernels view of the device, but it doesn't alter the
162 device state. This means that it might not be safe to toggle the
163 setting from "write back" to "write through", since that will also
164 eliminate cache flushes issued by the kernel.
165
166 write_same_max_bytes (RO)
167 -------------------------
168 This is the number of bytes the device can write in a single write-same
169 command.  A value of '0' means write-same is not supported by this
170 device.
171
172
173 Jens Axboe <jens.axboe@oracle.com>, February 2009