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