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