queue-sysfs.txt 6.2 KB

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