blob: dce25d848d92c67074ebd26ffaa526217f8f3957 [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
17discard_granularity (RO)
18-----------------------
19This shows the size of internal allocation of the device in bytes, if
20reported by the device. A value of '0' means device does not support
21the discard functionality.
22
Jens Axboe0034af02015-07-16 09:14:26 -060023discard_max_hw_bytes (RO)
Namjae Jeon4004e902012-08-09 15:28:05 +020024----------------------
25Devices that support discard functionality may have internal limits on
26the number of bytes that can be trimmed or unmapped in a single operation.
27The discard_max_bytes parameter is set by the device driver to the maximum
28number of bytes that can be discarded in a single operation. Discard
29requests issued to the device must not exceed this limit. A discard_max_bytes
30value of 0 means that the device does not support discard functionality.
31
Jens Axboe0034af02015-07-16 09:14:26 -060032discard_max_bytes (RW)
33----------------------
34While discard_max_hw_bytes is the hardware limit for the device, this
35setting is the software limit. Some devices exhibit large latencies when
36large discards are issued, setting this value lower will make Linux issue
37smaller discards and potentially help reduce latencies induced by large
38discard operations.
39
Namjae Jeon4004e902012-08-09 15:28:05 +020040discard_zeroes_data (RO)
41------------------------
42When read, this file will show if the discarded block are zeroed by the
43device or not. If its value is '1' the blocks are zeroed otherwise not.
44
Jens Axboecbb59012009-02-02 13:02:31 +010045hw_sector_size (RO)
46-------------------
47This is the hardware sector size of the device, in bytes.
48
Namjae Jeon4004e902012-08-09 15:28:05 +020049iostats (RW)
50-------------
51This file is used to control (on/off) the iostats accounting of the
52disk.
53
54logical_block_size (RO)
55-----------------------
56This is the logcal block size of the device, in bytes.
57
Jens Axboecbb59012009-02-02 13:02:31 +010058max_hw_sectors_kb (RO)
59----------------------
60This is the maximum number of kilobytes supported in a single data transfer.
61
Namjae Jeon4004e902012-08-09 15:28:05 +020062max_integrity_segments (RO)
63---------------------------
64When read, this file shows the max limit of integrity segments as
65set by block layer which a hardware controller can handle.
66
Jens Axboecbb59012009-02-02 13:02:31 +010067max_sectors_kb (RW)
68-------------------
69This is the maximum number of kilobytes that the block layer will allow
70for a filesystem request. Must be smaller than or equal to the maximum
71size allowed by the hardware.
72
Namjae Jeon4004e902012-08-09 15:28:05 +020073max_segments (RO)
74-----------------
75Maximum number of segments of the device.
76
77max_segment_size (RO)
78---------------------
79Maximum segment size of the device.
80
81minimum_io_size (RO)
82--------------------
Arnd Hannemanndb4ced12014-08-26 12:33:20 +020083This is the smallest preferred IO size reported by the device.
Namjae Jeon4004e902012-08-09 15:28:05 +020084
Jens Axboecbb59012009-02-02 13:02:31 +010085nomerges (RW)
86-------------
Alan D. Brunelle488991e2010-01-29 09:04:08 +010087This enables the user to disable the lookup logic involved with IO
88merging requests in the block layer. By default (0) all merges are
89enabled. When set to 1 only simple one-hit merges will be tried. When
90set to 2 no merge algorithms will be tried (including one-hit or more
91complex tree/hash lookups).
Jens Axboecbb59012009-02-02 13:02:31 +010092
93nr_requests (RW)
94----------------
95This controls how many requests may be allocated in the block layer for
96read or write requests. Note that the total allocated number may be twice
97this amount, since it applies only to reads or writes (not the accumulated
98sum).
99
Tejun Heoa0516612012-06-26 15:05:44 -0700100To avoid priority inversion through request starvation, a request
101queue maintains a separate request pool per each cgroup when
102CONFIG_BLK_CGROUP is enabled, and this parameter applies to each such
103per-block-cgroup request pool. IOW, if there are N block cgroups,
Anatol Pomozovf884ab12013-05-08 16:56:16 -0700104each request queue may have up to N request pools, each independently
Tejun Heoa0516612012-06-26 15:05:44 -0700105regulated by nr_requests.
106
Namjae Jeon4004e902012-08-09 15:28:05 +0200107optimal_io_size (RO)
108--------------------
Arnd Hannemanndb4ced12014-08-26 12:33:20 +0200109This is the optimal IO size reported by the device.
Namjae Jeon4004e902012-08-09 15:28:05 +0200110
111physical_block_size (RO)
112------------------------
113This is the physical block size of device, in bytes.
114
Jens Axboecbb59012009-02-02 13:02:31 +0100115read_ahead_kb (RW)
116------------------
117Maximum number of kilobytes to read-ahead for filesystems on this block
118device.
119
Namjae Jeon4004e902012-08-09 15:28:05 +0200120rotational (RW)
121---------------
122This file is used to stat if the device is of rotational type or
123non-rotational type.
124
Jens Axboecbb59012009-02-02 13:02:31 +0100125rq_affinity (RW)
126----------------
Dan Williams5757a6d2011-07-23 20:44:25 +0200127If this option is '1', the block layer will migrate request completions to the
128cpu "group" that originally submitted the request. For some workloads this
129provides a significant reduction in CPU cycles due to caching effects.
130
131For storage configurations that need to maximize distribution of completion
132processing setting this option to '2' forces the completion to run on the
133requesting cpu (bypassing the "group" aggregation logic).
Jens Axboecbb59012009-02-02 13:02:31 +0100134
135scheduler (RW)
136--------------
137When read, this file will display the current and available IO schedulers
138for this block device. The currently active IO scheduler will be enclosed
139in [] brackets. Writing an IO scheduler name to this file will switch
140control of this block device to that new IO scheduler. Note that writing
141an IO scheduler name to this file will attempt to load that IO scheduler
142module, if it isn't already present in the system.
143
Jens Axboe93e9d8e2016-04-12 12:32:46 -0600144write_cache (RW)
145----------------
146When read, this file will display whether the device has write back
147caching enabled or not. It will return "write back" for the former
148case, and "write through" for the latter. Writing to this file can
149change the kernels view of the device, but it doesn't alter the
150device state. This means that it might not be safe to toggle the
151setting from "write back" to "write through", since that will also
152eliminate cache flushes issued by the kernel.
Jens Axboecbb59012009-02-02 13:02:31 +0100153
154
155Jens Axboe <jens.axboe@oracle.com>, February 2009