queue-sysfs.txt 7.4 KB

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