← Documents Documentation/ABI/stable/sysfs-block GitHub 원문 ↗

Linux 6.18.37 · ABI / stable

Block device stable sysfs ABI

Block device와 partition의 alignment, atomic write, integrity, queue limit, inline crypto, discard, scheduler, write cache, zoned storage와 I/O 통계 attribute 72개를 설명합니다.

Source pathDocumentation/ABI/stable/sysfs-block
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

Disk 기본 속성과 atomic write

sysfs-block:1-103

Physical·logical alignment, atomic write 단위와 경계, disk sequence, in-flight read/write 수를 다룹니다.

Integrity metadata와 partition

sysfs-block:106-218

T10 Protection Information과 application tag, partition scan·alignment·통계를 다룹니다.

Queue crypto와 discard

sysfs-block:221-426

Inline encryption capability, discard hardware·software limit, DAX, FUA, independent access range를 다룹니다.

Queue poll, timeout과 I/O limit

sysfs-block:429-680

Polling, timeout, request·segment·zone 한계, merge, readahead, affinity를 다룹니다.

Scheduler, write와 zoned storage

sysfs-block:681-881

I/O scheduler, stable write, writeback throttling, cache, zeroing, zone model과 17개 통계 field를 다룹니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 What: /sys/block/<disk>/alignment_offset
2 Date: April 2009
3 Contact: Martin K. Petersen <martin.petersen@oracle.com>
4 Description:
5 Storage devices may report a physical block size that is
6 bigger than the logical block size (for instance a drive
7 with 4KB physical sectors exposing 512-byte logical
8 blocks to the operating system). This parameter
9 indicates how many bytes the beginning of the device is
10 offset from the disk's natural alignment.
11
12
13 What: /sys/block/<disk>/discard_alignment
14 Date: May 2011
15 Contact: Martin K. Petersen <martin.petersen@oracle.com>
16 Description:
17 Devices that support discard functionality may
18 internally allocate space in units that are bigger than
19 the exported logical block size. The discard_alignment
20 parameter indicates how many bytes the beginning of the
21 device is offset from the internal allocation unit's
22 natural alignment.
23
24 What: /sys/block/<disk>/atomic_write_max_bytes
25 Date: February 2024
26 Contact: Himanshu Madhani <himanshu.madhani@oracle.com>
27 Description:
28 [RO] This parameter specifies the maximum atomic write
29 size reported by the device. This parameter is relevant
30 for merging of writes, where a merged atomic write
31 operation must not exceed this number of bytes.
32 This parameter may be greater than the value in
33 atomic_write_unit_max_bytes as
34 atomic_write_unit_max_bytes will be rounded down to a
35 power-of-two and atomic_write_unit_max_bytes may also be
36 limited by some other queue limits, such as max_segments.
37 This parameter - along with atomic_write_unit_min_bytes
38 and atomic_write_unit_max_bytes - will not be larger than
39 max_hw_sectors_kb, but may be larger than max_sectors_kb.
40
41
42 What: /sys/block/<disk>/atomic_write_unit_min_bytes
43 Date: February 2024
44 Contact: Himanshu Madhani <himanshu.madhani@oracle.com>
45 Description:
46 [RO] This parameter specifies the smallest block which can
47 be written atomically with an atomic write operation. All
48 atomic write operations must begin at a
49 atomic_write_unit_min boundary and must be multiples of
50 atomic_write_unit_min. This value must be a power-of-two.
51
52
53 What: /sys/block/<disk>/atomic_write_unit_max_bytes
54 Date: February 2024
55 Contact: Himanshu Madhani <himanshu.madhani@oracle.com>
56 Description:
57 [RO] This parameter defines the largest block which can be
58 written atomically with an atomic write operation. This
59 value must be a multiple of atomic_write_unit_min and must
60 be a power-of-two. This value will not be larger than
61 atomic_write_max_bytes.
62
63
64 What: /sys/block/<disk>/atomic_write_boundary_bytes
65 Date: February 2024
66 Contact: Himanshu Madhani <himanshu.madhani@oracle.com>
67 Description:
68 [RO] A device may need to internally split an atomic write I/O
69 which straddles a given logical block address boundary. This
70 parameter specifies the size in bytes of the atomic boundary if
71 one is reported by the device. This value must be a
72 power-of-two and at least the size as in
73 atomic_write_unit_max_bytes.
74 Any attempt to merge atomic write I/Os must not result in a
75 merged I/O which crosses this boundary (if any).
76
77
78 What: /sys/block/<disk>/diskseq
79 Date: February 2021
80 Contact: Matteo Croce <teknoraver@meta.com>
81 Description:
82 The /sys/block/<disk>/diskseq files reports the disk
83 sequence number, which is a monotonically increasing
84 number assigned to every drive.
85 Some devices, like the loop device, refresh such number
86 every time the backing file is changed.
87 The value type is 64 bit unsigned.
88
89
90 What: /sys/block/<disk>/inflight
91 Date: October 2009
92 Contact: Jens Axboe <axboe@kernel.dk>, Nikanth Karthikesan <knikanth@suse.de>
93 Description:
94 Reports the number of I/O requests currently in progress
95 (pending / in flight) in a device driver. This can be less
96 than the number of requests queued in the block device queue.
97 The report contains 2 fields: one for read requests
98 and one for write requests.
99 The value type is unsigned int.
100 Cf. Documentation/block/stat.rst which contains a single value for
101 requests in flight.
102 This is related to /sys/block/<disk>/queue/nr_requests
103 and for SCSI device also its queue_depth.
104
105
106 What: /sys/block/<disk>/integrity/device_is_integrity_capable
107 Date: July 2014
108 Contact: Martin K. Petersen <martin.petersen@oracle.com>
109 Description:
110 Indicates whether a storage device is capable of storing
111 integrity metadata. Set if the device is T10 PI-capable.
112 This flag is set to 1 if the storage media is formatted
113 with T10 Protection Information. If the storage media is
114 not formatted with T10 Protection Information, this flag
115 is set to 0.
116
117
118 What: /sys/block/<disk>/integrity/format
119 Date: June 2008
120 Contact: Martin K. Petersen <martin.petersen@oracle.com>
121 Description:
122 Metadata format for integrity capable block device.
123 E.g. T10-DIF-TYPE1-CRC.
124 This field describes the type of T10 Protection Information
125 that the block device can send and receive.
126 If the device can store application integrity metadata but
127 no T10 Protection Information profile is used, this field
128 contains "nop".
129 If the device does not support integrity metadata, this
130 field contains "none".
131
132
133 What: /sys/block/<disk>/integrity/protection_interval_bytes
134 Date: July 2015
135 Contact: Martin K. Petersen <martin.petersen@oracle.com>
136 Description:
137 Describes the number of data bytes which are protected
138 by one integrity tuple. Typically the device's logical
139 block size.
140
141
142 What: /sys/block/<disk>/integrity/read_verify
143 Date: June 2008
144 Contact: Martin K. Petersen <martin.petersen@oracle.com>
145 Description:
146 Indicates whether the block layer should verify the
147 integrity of read requests serviced by devices that
148 support sending integrity metadata.
149
150
151 What: /sys/block/<disk>/integrity/tag_size
152 Date: June 2008
153 Contact: Martin K. Petersen <martin.petersen@oracle.com>
154 Description:
155 Number of bytes of integrity tag space available per
156 protection_interval_bytes, which is typically
157 the device's logical block size.
158 This field describes the size of the application tag
159 if the storage device is formatted with T10 Protection
160 Information and permits use of the application tag.
161 The tag_size is reported in bytes and indicates the
162 space available for adding an opaque tag to each block
163 (protection_interval_bytes).
164 If the device does not support T10 Protection Information
165 (even if the device provides application integrity
166 metadata space), this field is set to 0.
167
168
169 What: /sys/block/<disk>/integrity/write_generate
170 Date: June 2008
171 Contact: Martin K. Petersen <martin.petersen@oracle.com>
172 Description:
173 Indicates whether the block layer should automatically
174 generate checksums for write requests bound for
175 devices that support receiving integrity metadata.
176
177
178 What: /sys/block/<disk>/partscan
179 Date: May 2024
180 Contact: Christoph Hellwig <hch@lst.de>
181 Description:
182 The /sys/block/<disk>/partscan files reports if partition
183 scanning is enabled for the disk. It returns "1" if partition
184 scanning is enabled, or "0" if not. The value type is a 32-bit
185 unsigned integer, but only "0" and "1" are valid values.
186
187
188 What: /sys/block/<disk>/<partition>/alignment_offset
189 Date: April 2009
190 Contact: Martin K. Petersen <martin.petersen@oracle.com>
191 Description:
192 Storage devices may report a physical block size that is
193 bigger than the logical block size (for instance a drive
194 with 4KB physical sectors exposing 512-byte logical
195 blocks to the operating system). This parameter
196 indicates how many bytes the beginning of the partition
197 is offset from the disk's natural alignment.
198
199
200 What: /sys/block/<disk>/<partition>/discard_alignment
201 Date: May 2011
202 Contact: Martin K. Petersen <martin.petersen@oracle.com>
203 Description:
204 Devices that support discard functionality may
205 internally allocate space in units that are bigger than
206 the exported logical block size. The discard_alignment
207 parameter indicates how many bytes the beginning of the
208 partition is offset from the internal allocation unit's
209 natural alignment.
210
211
212 What: /sys/block/<disk>/<partition>/stat
213 Date: February 2008
214 Contact: Jerome Marchand <jmarchan@redhat.com>
215 Description:
216 The /sys/block/<disk>/<partition>/stat files display the
217 I/O statistics of partition <partition>. The format is the
218 same as the format of /sys/block/<disk>/stat.
219
220
221 What: /sys/block/<disk>/queue/add_random
222 Date: June 2010
223 Contact: linux-block@vger.kernel.org
224 Description:
225 [RW] This file allows to turn off the disk entropy contribution.
226 Default value of this file is '1'(on).
227
228
229 What: /sys/block/<disk>/queue/chunk_sectors
230 Date: September 2016
231 Contact: Hannes Reinecke <hare@suse.com>
232 Description:
233 [RO] chunk_sectors has different meaning depending on the type
234 of the disk. For a RAID device (dm-raid), chunk_sectors
235 indicates the size in 512B sectors of the RAID volume stripe
236 segment. For a zoned block device, either host-aware or
237 host-managed, chunk_sectors indicates the size in 512B sectors
238 of the zones of the device, with the eventual exception of the
239 last zone of the device which may be smaller.
240
241
242 What: /sys/block/<disk>/queue/crypto/
243 Date: February 2022
244 Contact: linux-block@vger.kernel.org
245 Description:
246 The presence of this subdirectory of /sys/block/<disk>/queue/
247 indicates that the device supports inline encryption. This
248 subdirectory contains files which describe the inline encryption
249 capabilities of the device. For more information about inline
250 encryption, refer to Documentation/block/inline-encryption.rst.
251
252
253 What: /sys/block/<disk>/queue/crypto/hw_wrapped_keys
254 Date: February 2025
255 Contact: linux-block@vger.kernel.org
256 Description:
257 [RO] The presence of this file indicates that the device
258 supports hardware-wrapped inline encryption keys, i.e. key blobs
259 that can only be unwrapped and used by dedicated hardware. For
260 more information about hardware-wrapped inline encryption keys,
261 see Documentation/block/inline-encryption.rst.
262
263
264 What: /sys/block/<disk>/queue/crypto/max_dun_bits
265 Date: February 2022
266 Contact: linux-block@vger.kernel.org
267 Description:
268 [RO] This file shows the maximum length, in bits, of data unit
269 numbers accepted by the device in inline encryption requests.
270
271
272 What: /sys/block/<disk>/queue/crypto/modes/<mode>
273 Date: February 2022
274 Contact: linux-block@vger.kernel.org
275 Description:
276 [RO] For each crypto mode (i.e., encryption/decryption
277 algorithm) the device supports with inline encryption, a file
278 will exist at this location. It will contain a hexadecimal
279 number that is a bitmask of the supported data unit sizes, in
280 bytes, for that crypto mode.
281
282 Currently, the crypto modes that may be supported are:
283
284 * AES-256-XTS
285 * AES-128-CBC-ESSIV
286 * Adiantum
287
288 For example, if a device supports AES-256-XTS inline encryption
289 with data unit sizes of 512 and 4096 bytes, the file
290 /sys/block/<disk>/queue/crypto/modes/AES-256-XTS will exist and
291 will contain "0x1200".
292
293
294 What: /sys/block/<disk>/queue/crypto/num_keyslots
295 Date: February 2022
296 Contact: linux-block@vger.kernel.org
297 Description:
298 [RO] This file shows the number of keyslots the device has for
299 use with inline encryption.
300
301
302 What: /sys/block/<disk>/queue/crypto/raw_keys
303 Date: February 2025
304 Contact: linux-block@vger.kernel.org
305 Description:
306 [RO] The presence of this file indicates that the device
307 supports raw inline encryption keys, i.e. keys that are managed
308 in raw, plaintext form in software.
309
310
311 What: /sys/block/<disk>/queue/dax
312 Date: June 2016
313 Contact: linux-block@vger.kernel.org
314 Description:
315 [RO] This file indicates whether the device supports Direct
316 Access (DAX), used by CPU-addressable storage to bypass the
317 pagecache. It shows '1' if true, '0' if not.
318
319
320 What: /sys/block/<disk>/queue/discard_granularity
321 Date: May 2011
322 Contact: Martin K. Petersen <martin.petersen@oracle.com>
323 Description:
324 [RO] Devices that support discard functionality may internally
325 allocate space using units that are bigger than the logical
326 block size. The discard_granularity parameter indicates the size
327 of the internal allocation unit in bytes if reported by the
328 device. Otherwise the discard_granularity will be set to match
329 the device's physical block size. A discard_granularity of 0
330 means that the device does not support discard functionality.
331
332
333 What: /sys/block/<disk>/queue/discard_max_bytes
334 Date: May 2011
335 Contact: Martin K. Petersen <martin.petersen@oracle.com>
336 Description:
337 [RW] While discard_max_hw_bytes is the hardware limit for the
338 device, this setting is the software limit. Some devices exhibit
339 large latencies when large discards are issued, setting this
340 value lower will make Linux issue smaller discards and
341 potentially help reduce latencies induced by large discard
342 operations.
343
344
345 What: /sys/block/<disk>/queue/discard_max_hw_bytes
346 Date: July 2015
347 Contact: linux-block@vger.kernel.org
348 Description:
349 [RO] Devices that support discard functionality may have
350 internal limits on the number of bytes that can be trimmed or
351 unmapped in a single operation. The `discard_max_hw_bytes`
352 parameter is set by the device driver to the maximum number of
353 bytes that can be discarded in a single operation. Discard
354 requests issued to the device must not exceed this limit. A
355 `discard_max_hw_bytes` value of 0 means that the device does not
356 support discard functionality.
357
358
359 What: /sys/block/<disk>/queue/discard_zeroes_data
360 Date: May 2011
361 Contact: Martin K. Petersen <martin.petersen@oracle.com>
362 Description:
363 [RO] Will always return 0. Don't rely on any specific behavior
364 for discards, and don't read this file.
365
366
367 What: /sys/block/<disk>/queue/dma_alignment
368 Date: May 2022
369 Contact: linux-block@vger.kernel.org
370 Description:
371 Reports the alignment that user space addresses must have to be
372 used for raw block device access with O_DIRECT and other driver
373 specific passthrough mechanisms.
374
375
376 What: /sys/block/<disk>/queue/fua
377 Date: May 2018
378 Contact: linux-block@vger.kernel.org
379 Description:
380 [RO] Whether or not the block driver supports the FUA flag for
381 write requests. FUA stands for Force Unit Access. If the FUA
382 flag is set that means that write requests must bypass the
383 volatile cache of the storage device.
384
385
386 What: /sys/block/<disk>/queue/hw_sector_size
387 Date: January 2008
388 Contact: linux-block@vger.kernel.org
389 Description:
390 [RO] This is the hardware sector size of the device, in bytes.
391
392
393 What: /sys/block/<disk>/queue/independent_access_ranges/
394 Date: October 2021
395 Contact: linux-block@vger.kernel.org
396 Description:
397 [RO] The presence of this sub-directory of the
398 /sys/block/xxx/queue/ directory indicates that the device is
399 capable of executing requests targeting different sector ranges
400 in parallel. For instance, single LUN multi-actuator hard-disks
401 will have an independent_access_ranges directory if the device
402 correctly advertises the sector ranges of its actuators.
403
404 The independent_access_ranges directory contains one directory
405 per access range, with each range described using the sector
406 (RO) attribute file to indicate the first sector of the range
407 and the nr_sectors (RO) attribute file to indicate the total
408 number of sectors in the range starting from the first sector of
409 the range. For example, a dual-actuator hard-disk will have the
410 following independent_access_ranges entries.::
411
412 $ tree /sys/block/<disk>/queue/independent_access_ranges/
413 /sys/block/<disk>/queue/independent_access_ranges/
414 |-- 0
415 | |-- nr_sectors
416 | `-- sector
417 `-- 1
418 |-- nr_sectors
419 `-- sector
420
421 The sector and nr_sectors attributes use 512B sector unit,
422 regardless of the actual block size of the device. Independent
423 access ranges do not overlap and include all sectors within the
424 device capacity. The access ranges are numbered in increasing
425 order of the range start sector, that is, the sector attribute
426 of range 0 always has the value 0.
427
428
429 What: /sys/block/<disk>/queue/io_poll
430 Date: November 2015
431 Contact: linux-block@vger.kernel.org
432 Description:
433 [RW] When read, this file shows whether polling is enabled (1)
434 or disabled (0). Writing '0' to this file will disable polling
435 for this device. Writing any non-zero value will enable this
436 feature.
437
438
439 What: /sys/block/<disk>/queue/io_poll_delay
440 Date: November 2016
441 Contact: linux-block@vger.kernel.org
442 Description:
443 [RW] This was used to control what kind of polling will be
444 performed. It is now fixed to -1, which is classic polling.
445 In this mode, the CPU will repeatedly ask for completions
446 without giving up any time.
447 <deprecated>
448
449
450 What: /sys/block/<disk>/queue/io_timeout
451 Date: November 2018
452 Contact: Weiping Zhang <zhangweiping@didiglobal.com>
453 Description:
454 [RW] io_timeout is the request timeout in milliseconds. If a
455 request does not complete in this time then the block driver
456 timeout handler is invoked. That timeout handler can decide to
457 retry the request, to fail it or to start a device recovery
458 strategy.
459
460
461 What: /sys/block/<disk>/queue/iostats
462 Date: January 2009
463 Contact: linux-block@vger.kernel.org
464 Description:
465 [RW] This file is used to control (on/off) the iostats
466 accounting of the disk.
467
468 What: /sys/block/<disk>/queue/iostats_passthrough
469 Date: October 2024
470 Contact: linux-block@vger.kernel.org
471 Description:
472 [RW] This file is used to control (on/off) the iostats
473 accounting of the disk for passthrough commands.
474
475
476 What: /sys/block/<disk>/queue/logical_block_size
477 Date: May 2009
478 Contact: Martin K. Petersen <martin.petersen@oracle.com>
479 Description:
480 [RO] This is the smallest unit the storage device can address.
481 It is typically 512 bytes.
482
483
484 What: /sys/block/<disk>/queue/max_active_zones
485 Date: July 2020
486 Contact: Niklas Cassel <niklas.cassel@wdc.com>
487 Description:
488 [RO] For zoned block devices (zoned attribute indicating
489 "host-managed" or "host-aware"), the sum of zones belonging to
490 any of the zone states: EXPLICIT OPEN, IMPLICIT OPEN or CLOSED,
491 is limited by this value. If this value is 0, there is no limit.
492
493 If the host attempts to exceed this limit, the driver should
494 report this error with BLK_STS_ZONE_ACTIVE_RESOURCE, which user
495 space may see as the EOVERFLOW errno.
496
497
498 What: /sys/block/<disk>/queue/max_discard_segments
499 Date: February 2017
500 Contact: linux-block@vger.kernel.org
501 Description:
502 [RO] The maximum number of DMA scatter/gather entries in a
503 discard request.
504
505
506 What: /sys/block/<disk>/queue/max_hw_sectors_kb
507 Date: September 2004
508 Contact: linux-block@vger.kernel.org
509 Description:
510 [RO] This is the maximum number of kilobytes supported in a
511 single data transfer.
512
513
514 What: /sys/block/<disk>/queue/max_integrity_segments
515 Date: September 2010
516 Contact: linux-block@vger.kernel.org
517 Description:
518 [RO] Maximum number of elements in a DMA scatter/gather list
519 with integrity data that will be submitted by the block layer
520 core to the associated block driver.
521
522
523 What: /sys/block/<disk>/queue/max_open_zones
524 Date: July 2020
525 Contact: Niklas Cassel <niklas.cassel@wdc.com>
526 Description:
527 [RO] For zoned block devices (zoned attribute indicating
528 "host-managed" or "host-aware"), the sum of zones belonging to
529 any of the zone states: EXPLICIT OPEN or IMPLICIT OPEN, is
530 limited by this value. If this value is 0, there is no limit.
531
532
533 What: /sys/block/<disk>/queue/max_sectors_kb
534 Date: September 2004
535 Contact: linux-block@vger.kernel.org
536 Description:
537 [RW] This is the maximum number of kilobytes that the block
538 layer will allow for a filesystem request. Must be smaller than
539 or equal to the maximum size allowed by the hardware. Write 0
540 to use default kernel settings.
541
542
543 What: /sys/block/<disk>/queue/max_segment_size
544 Date: March 2010
545 Contact: linux-block@vger.kernel.org
546 Description:
547 [RO] Maximum size in bytes of a single element in a DMA
548 scatter/gather list.
549
550 What: /sys/block/<disk>/queue/max_write_streams
551 Date: November 2024
552 Contact: linux-block@vger.kernel.org
553 Description:
554 [RO] Maximum number of write streams supported, 0 if not
555 supported. If supported, valid values are 1 through
556 max_write_streams, inclusive.
557
558 What: /sys/block/<disk>/queue/write_stream_granularity
559 Date: November 2024
560 Contact: linux-block@vger.kernel.org
561 Description:
562 [RO] Granularity of a write stream in bytes. The granularity
563 of a write stream is the size that should be discarded or
564 overwritten together to avoid write amplification in the device.
565
566 What: /sys/block/<disk>/queue/max_segments
567 Date: March 2010
568 Contact: linux-block@vger.kernel.org
569 Description:
570 [RO] Maximum number of elements in a DMA scatter/gather list
571 that is submitted to the associated block driver.
572
573
574 What: /sys/block/<disk>/queue/minimum_io_size
575 Date: April 2009
576 Contact: Martin K. Petersen <martin.petersen@oracle.com>
577 Description:
578 [RO] Storage devices may report a granularity or preferred
579 minimum I/O size which is the smallest request the device can
580 perform without incurring a performance penalty. For disk
581 drives this is often the physical block size. For RAID arrays
582 it is often the stripe chunk size. A properly aligned multiple
583 of minimum_io_size is the preferred request size for workloads
584 where a high number of I/O operations is desired.
585
586
587 What: /sys/block/<disk>/queue/nomerges
588 Date: January 2010
589 Contact: linux-block@vger.kernel.org
590 Description:
591 [RW] Standard I/O elevator operations include attempts to merge
592 contiguous I/Os. For known random I/O loads these attempts will
593 always fail and result in extra cycles being spent in the
594 kernel. This allows one to turn off this behavior on one of two
595 ways: When set to 1, complex merge checks are disabled, but the
596 simple one-shot merges with the previous I/O request are
597 enabled. When set to 2, all merge tries are disabled. The
598 default value is 0 - which enables all types of merge tries.
599
600
601 What: /sys/block/<disk>/queue/nr_requests
602 Date: July 2003
603 Contact: linux-block@vger.kernel.org
604 Description:
605 [RW] This controls how many requests may be allocated in the
606 block layer. Noted this value only represents the quantity for a
607 single blk_mq_tags instance. The actual number for the entire
608 device depends on the hardware queue count, whether elevator is
609 enabled, and whether tags are shared.
610
611
612 What: /sys/block/<disk>/queue/nr_zones
613 Date: November 2018
614 Contact: Damien Le Moal <damien.lemoal@wdc.com>
615 Description:
616 [RO] nr_zones indicates the total number of zones of a zoned
617 block device ("host-aware" or "host-managed" zone model). For
618 regular block devices, the value is always 0.
619
620
621 What: /sys/block/<disk>/queue/optimal_io_size
622 Date: April 2009
623 Contact: Martin K. Petersen <martin.petersen@oracle.com>
624 Description:
625 [RO] Storage devices may report an optimal I/O size, which is
626 the device's preferred unit for sustained I/O. This is rarely
627 reported for disk drives. For RAID arrays it is usually the
628 stripe width or the internal track size. A properly aligned
629 multiple of optimal_io_size is the preferred request size for
630 workloads where sustained throughput is desired. If no optimal
631 I/O size is reported this file contains 0.
632
633
634 What: /sys/block/<disk>/queue/physical_block_size
635 Date: May 2009
636 Contact: Martin K. Petersen <martin.petersen@oracle.com>
637 Description:
638 [RO] This is the smallest unit a physical storage device can
639 write atomically. It is usually the same as the logical block
640 size but may be bigger. One example is SATA drives with 4KB
641 sectors that expose a 512-byte logical block size to the
642 operating system. For stacked block devices the
643 physical_block_size variable contains the maximum
644 physical_block_size of the component devices.
645
646
647 What: /sys/block/<disk>/queue/read_ahead_kb
648 Date: May 2004
649 Contact: linux-block@vger.kernel.org
650 Description:
651 [RW] Maximum number of kilobytes to read-ahead for filesystems
652 on this block device.
653
654 For MADV_HUGEPAGE, the readahead size may exceed this setting
655 since its granularity is based on the hugepage size.
656
657
658 What: /sys/block/<disk>/queue/rotational
659 Date: January 2009
660 Contact: linux-block@vger.kernel.org
661 Description:
662 [RW] This file is used to stat if the device is of rotational
663 type or non-rotational type.
664
665
666 What: /sys/block/<disk>/queue/rq_affinity
667 Date: September 2008
668 Contact: linux-block@vger.kernel.org
669 Description:
670 [RW] If this option is '1', the block layer will migrate request
671 completions to the cpu "group" that originally submitted the
672 request. For some workloads this provides a significant
673 reduction in CPU cycles due to caching effects.
674
675 For storage configurations that need to maximize distribution of
676 completion processing setting this option to '2' forces the
677 completion to run on the requesting cpu (bypassing the "group"
678 aggregation logic).
679
680
681 What: /sys/block/<disk>/queue/scheduler
682 Date: October 2004
683 Contact: linux-block@vger.kernel.org
684 Description:
685 [RW] When read, this file will display the current and available
686 IO schedulers for this block device. The currently active IO
687 scheduler will be enclosed in [] brackets. Writing an IO
688 scheduler name to this file will switch control of this block
689 device to that new IO scheduler. Note that writing an IO
690 scheduler name to this file will attempt to load that IO
691 scheduler module, if it isn't already present in the system.
692
693
694 What: /sys/block/<disk>/queue/stable_writes
695 Date: September 2020
696 Contact: linux-block@vger.kernel.org
697 Description:
698 [RW] This file will contain '1' if memory must not be modified
699 while it is being used in a write request to this device. When
700 this is the case and the kernel is performing writeback of a
701 page, the kernel will wait for writeback to complete before
702 allowing the page to be modified again, rather than allowing
703 immediate modification as is normally the case. This
704 restriction arises when the device accesses the memory multiple
705 times where the same data must be seen every time -- for
706 example, once to calculate a checksum and once to actually write
707 the data. If no such restriction exists, this file will contain
708 '0'. This file is writable for testing purposes.
709
710 What: /sys/block/<disk>/queue/virt_boundary_mask
711 Date: April 2021
712 Contact: linux-block@vger.kernel.org
713 Description:
714 [RO] This file shows the I/O segment memory alignment mask for
715 the block device. I/O requests to this device will be split
716 between segments wherever either the memory address of the end
717 of the previous segment or the memory address of the beginning
718 of the current segment is not aligned to virt_boundary_mask + 1
719 bytes.
720
721
722 What: /sys/block/<disk>/queue/wbt_lat_usec
723 Date: November 2016
724 Contact: linux-block@vger.kernel.org
725 Description:
726 [RW] If the device is registered for writeback throttling, then
727 this file shows the target minimum read latency. If this latency
728 is exceeded in a given window of time (see curr_win_nsec), then
729 the writeback throttling will start scaling back writes. Writing
730 a value of '0' to this file disables the feature. Writing a
731 value of '-1' to this file resets the value to the default
732 setting.
733
734
735 What: /sys/block/<disk>/queue/write_cache
736 Date: April 2016
737 Contact: linux-block@vger.kernel.org
738 Description:
739 [RW] When read, this file will display whether the device has
740 write back caching enabled or not. It will return "write back"
741 for the former case, and "write through" for the latter. Writing
742 to this file can change the kernels view of the device, but it
743 doesn't alter the device state. This means that it might not be
744 safe to toggle the setting from "write back" to "write through",
745 since that will also eliminate cache flushes issued by the
746 kernel.
747
748
749 What: /sys/block/<disk>/queue/write_same_max_bytes
750 Date: January 2012
751 Contact: Martin K. Petersen <martin.petersen@oracle.com>
752 Description:
753 [RO] Some devices support a write same operation in which a
754 single data block can be written to a range of several
755 contiguous blocks on storage. This can be used to wipe areas on
756 disk or to initialize drives in a RAID configuration.
757 write_same_max_bytes indicates how many bytes can be written in
758 a single write same command. If write_same_max_bytes is 0, write
759 same is not supported by the device.
760
761
762 What: /sys/block/<disk>/queue/write_zeroes_max_bytes
763 Date: November 2016
764 Contact: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
765 Description:
766 [RO] Devices that support write zeroes operation in which a
767 single request can be issued to zero out the range of contiguous
768 blocks on storage without having any payload in the request.
769 This can be used to optimize writing zeroes to the devices.
770 write_zeroes_max_bytes indicates how many bytes can be written
771 in a single write zeroes command. If write_zeroes_max_bytes is
772 0, write zeroes is not supported by the device.
773
774
775 What: /sys/block/<disk>/queue/write_zeroes_unmap_max_hw_bytes
776 Date: January 2025
777 Contact: Zhang Yi <yi.zhang@huawei.com>
778 Description:
779 [RO] This file indicates whether a device supports zeroing data
780 in a specified block range without incurring the cost of
781 physically writing zeroes to the media for each individual
782 block. If this parameter is set to write_zeroes_max_bytes, the
783 device implements a zeroing operation which opportunistically
784 avoids writing zeroes to media while still guaranteeing that
785 subsequent reads from the specified block range will return
786 zeroed data. This operation is a best-effort optimization, a
787 device may fall back to physically writing zeroes to the media
788 due to other factors such as misalignment or being asked to
789 clear a block range smaller than the device's internal
790 allocation unit. If this parameter is set to 0, the device may
791 have to write each logical block media during a zeroing
792 operation.
793
794
795 What: /sys/block/<disk>/queue/write_zeroes_unmap_max_bytes
796 Date: January 2025
797 Contact: Zhang Yi <yi.zhang@huawei.com>
798 Description:
799 [RW] While write_zeroes_unmap_max_hw_bytes is the hardware limit
800 for the device, this setting is the software limit. Since the
801 unmap write zeroes operation is a best-effort optimization, some
802 devices may still physically writing zeroes to media. So the
803 speed of this operation is not guaranteed. Writing a value of
804 '0' to this file disables this operation. Otherwise, this
805 parameter should be equal to write_zeroes_unmap_max_hw_bytes.
806
807
808 What: /sys/block/<disk>/queue/zone_append_max_bytes
809 Date: May 2020
810 Contact: linux-block@vger.kernel.org
811 Description:
812 [RO] This is the maximum number of bytes that can be written to
813 a sequential zone of a zoned block device using a zone append
814 write operation (REQ_OP_ZONE_APPEND). This value is always 0 for
815 regular block devices.
816
817
818 What: /sys/block/<disk>/queue/zone_write_granularity
819 Date: January 2021
820 Contact: linux-block@vger.kernel.org
821 Description:
822 [RO] This indicates the alignment constraint, in bytes, for
823 write operations in sequential zones of zoned block devices
824 (devices with a zoned attributed that reports "host-managed" or
825 "host-aware"). This value is always 0 for regular block devices.
826
827
828 What: /sys/block/<disk>/queue/zoned
829 Date: September 2016
830 Contact: Damien Le Moal <damien.lemoal@wdc.com>
831 Description:
832 [RO] zoned indicates if the device is a zoned block device and
833 the zone model of the device if it is indeed zoned. The
834 possible values indicated by zoned are "none" for regular block
835 devices and "host-aware" or "host-managed" for zoned block
836 devices. The characteristics of host-aware and host-managed
837 zoned block devices are described in the ZBC (Zoned Block
838 Commands) and ZAC (Zoned Device ATA Command Set) standards.
839 These standards also define the "drive-managed" zone model.
840 However, since drive-managed zoned block devices do not support
841 zone commands, they will be treated as regular block devices and
842 zoned will report "none".
843
844
845 What: /sys/block/<disk>/hidden
846 Date: March 2023
847 Contact: linux-block@vger.kernel.org
848 Description:
849 [RO] the block device is hidden. it doesn’t produce events, and
850 can’t be opened from userspace or using blkdev_get*.
851 Used for the underlying components of multipath devices.
852
853
854 What: /sys/block/<disk>/stat
855 Date: February 2008
856 Contact: Jerome Marchand <jmarchan@redhat.com>
857 Description:
858 The /sys/block/<disk>/stat files displays the I/O
859 statistics of disk <disk>. They contain 11 fields:
860
861 == ==============================================
862 1 reads completed successfully
863 2 reads merged
864 3 sectors read
865 4 time spent reading (ms)
866 5 writes completed
867 6 writes merged
868 7 sectors written
869 8 time spent writing (ms)
870 9 I/Os currently in progress
871 10 time spent doing I/Os (ms)
872 11 weighted time spent doing I/Os (ms)
873 12 discards completed
874 13 discards merged
875 14 sectors discarded
876 15 time spent discarding (ms)
877 16 flush requests completed
878 17 time spent flushing (ms)
879 == ==============================================
880
881 For more details refer Documentation/admin-guide/iostats.rst
882

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

Disk alignment, atomic write와 실행 중 I/O

1-103
경로작성 시점·담당의미
/sys/block/<disk>/alignment_offset2009년 4월 · Martin K. PetersenStorage device는 logical block보다 큰 physical block size를 보고할 수 있다. 예를 들어 4KB physical sector drive가 OS에는 512-byte logical block을 노출할 수 있다. 이 값은 device 시작점이 disk의 자연스러운 alignment에서 몇 byte 떨어져 있는지 나타낸다.
/sys/block/<disk>/discard_alignment2011년 5월 · Martin K. PetersenDiscard 지원 device가 exported logical block보다 큰 단위로 내부 공간을 할당할 때, device 시작점이 내부 allocation unit의 자연스러운 alignment에서 몇 byte 떨어져 있는지 나타낸다.
/sys/block/<disk>/atomic_write_max_bytes2024년 2월 · Himanshu Madhani · read-onlyDevice가 보고한 최대 atomic write 크기다. Write를 merge할 때 merged atomic write가 이 값을 넘으면 안 된다. atomic_write_unit_max_bytes는 2의 거듭제곱으로 내림되고 max_segments 같은 queue limit에도 제한될 수 있어 이 값이 더 클 수 있다. 이 값과 두 atomic_write_unit 값은 max_hw_sectors_kb보다 크지 않지만 max_sectors_kb보다 클 수 있다.
/sys/block/<disk>/atomic_write_unit_min_bytes2024년 2월 · Himanshu Madhani · read-onlyAtomic write operation으로 원자적으로 쓸 수 있는 가장 작은 block이다. 모든 atomic write는 이 단위의 경계에서 시작하고 이 단위의 배수여야 한다. 값은 2의 거듭제곱이어야 한다.
/sys/block/<disk>/atomic_write_unit_max_bytes2024년 2월 · Himanshu Madhani · read-onlyAtomic write operation으로 원자적으로 쓸 수 있는 가장 큰 block이다. atomic_write_unit_min의 배수이자 2의 거듭제곱이어야 하며 atomic_write_max_bytes보다 클 수 없다.
/sys/block/<disk>/atomic_write_boundary_bytes2024년 2월 · Himanshu Madhani · read-onlyDevice가 특정 logical block address 경계를 가로지르는 atomic write I/O를 내부에서 나눠야 할 때 그 경계 크기를 byte로 나타낸다. 2의 거듭제곱이며 atomic_write_unit_max_bytes 이상이어야 한다. Atomic write I/O를 merge한 결과가 이 경계를 가로질러서는 안 된다.
/sys/block/<disk>/diskseq2021년 2월 · Matteo Croce모든 drive에 할당하는 단조 증가 64-bit unsigned sequence number다. Loop device 같은 일부 device는 backing file이 바뀔 때마다 번호를 갱신한다.
/sys/block/<disk>/inflight2009년 10월 · Jens Axboe, Nikanth KarthikesanDevice driver에서 현재 진행 중인 pending/in-flight I/O request 수를 보고한다. Block queue에 들어 있는 request 수보다 작을 수 있다. unsigned int인 read request와 write request 두 field를 제공한다. Documentation/block/stat.rst의 단일 in-flight 값, queue/nr_requests, SCSI queue_depth와 관련된다.

Integrity metadata

106-175

아래 항목의 담당자는 Martin K. Petersen <martin.petersen@oracle.com>이다.

경로작성 시점의미
/sys/block/<disk>/integrity/device_is_integrity_capable2014년 7월Storage device가 integrity metadata를 저장할 수 있는지 나타낸다. T10 PI-capable device이며 media가 T10 Protection Information으로 format돼 있으면 1, 아니면 0이다.
/sys/block/<disk>/integrity/format2008년 6월Integrity capable block device의 metadata format이다. 예시는 T10-DIF-TYPE1-CRC다. Device가 송수신할 수 있는 T10 Protection Information type을 설명한다. Application integrity metadata를 저장할 수 있지만 T10 PI profile을 쓰지 않으면 nop, integrity metadata를 지원하지 않으면 none이다.
/sys/block/<disk>/integrity/protection_interval_bytes2015년 7월Integrity tuple 하나가 보호하는 data byte 수다. 일반적으로 device logical block size다.
/sys/block/<disk>/integrity/read_verify2008년 6월Integrity metadata를 보내는 device가 처리한 read request의 integrity를 block layer가 검증할지 나타낸다.
/sys/block/<disk>/integrity/tag_size2008년 6월protection_interval_bytes마다 사용할 수 있는 integrity tag 공간의 byte 수다. T10 PI로 format되고 application tag를 허용하면 block마다 opaque tag를 추가할 공간을 나타낸다. Application metadata 공간이 있더라도 T10 PI를 지원하지 않으면 0이다.
/sys/block/<disk>/integrity/write_generate2008년 6월Integrity metadata 수신을 지원하는 device로 보낼 write request의 checksum을 block layer가 자동 생성할지 나타낸다.

Partition scan, alignment와 통계

178-218
경로작성 시점·담당의미
/sys/block/<disk>/partscan2024년 5월 · Christoph HellwigDisk의 partition scanning이 활성화됐으면 1, 아니면 0을 보고한다. Type은 32-bit unsigned integer지만 0과 1만 유효하다.
/sys/block/<disk>/<partition>/alignment_offset2009년 4월 · Martin K. PetersenPartition 시작점이 disk의 자연스러운 alignment에서 몇 byte 떨어져 있는지 나타낸다. 4KB physical sector와 512-byte logical block처럼 physical block이 더 큰 device에서 필요하다.
/sys/block/<disk>/<partition>/discard_alignment2011년 5월 · Martin K. PetersenPartition 시작점이 device 내부 discard allocation unit의 자연스러운 alignment에서 몇 byte 떨어져 있는지 나타낸다.
/sys/block/<disk>/<partition>/stat2008년 2월 · Jerome Marchand해당 partition의 I/O 통계를 표시하며 형식은 /sys/block/<disk>/stat과 같다.

Entropy, chunk와 inline encryption

221-308
경로작성 시점·접근의미
/sys/block/<disk>/queue/add_random2010년 6월 · read/writeDisk의 entropy 기여를 끌 수 있다. 기본값은 1, 즉 켜짐이다. Contact는 linux-block@vger.kernel.org다.
/sys/block/<disk>/queue/chunk_sectors2016년 9월 · read-onlyDisk type에 따라 의미가 다르다. RAID device(dm-raid)에서는 RAID volume stripe segment 크기를 512B sector 단위로 나타낸다. Host-aware 또는 host-managed zoned block device에서는 zone 크기를 512B sector 단위로 나타내며 마지막 zone은 더 작을 수 있다. 담당자는 Hannes Reinecke다.
/sys/block/<disk>/queue/crypto/2022년 2월이 subdirectory가 있으면 device가 inline encryption을 지원한다. 내부 file은 device의 inline encryption capability를 설명한다. 자세한 내용은 Documentation/block/inline-encryption.rst를 참조한다.
/sys/block/<disk>/queue/crypto/hw_wrapped_keys2025년 2월 · read-only이 file이 있으면 전용 hardware만 unwrap하고 사용할 수 있는 key blob, 즉 hardware-wrapped inline encryption key를 지원한다.
/sys/block/<disk>/queue/crypto/max_dun_bits2022년 2월 · read-onlyInline encryption request에서 device가 받는 data unit number의 최대 bit 길이다.
/sys/block/<disk>/queue/crypto/num_keyslots2022년 2월 · read-onlyInline encryption에 사용할 수 있는 device keyslot 수다.
/sys/block/<disk>/queue/crypto/raw_keys2025년 2월 · read-only이 file이 있으면 software에서 raw plaintext 형태로 관리하는 inline encryption key를 지원한다.

crypto/modes/<mode>

Device가 inline encryption으로 지원하는 crypto mode, 즉 encryption/decryption algorithm마다 read-only file이 하나 생긴다. File의 16진수 값은 해당 mode가 지원하는 byte 단위 data unit size의 bitmask다. 현재 가능한 mode는 AES-256-XTS, AES-128-CBC-ESSIV, Adiantum이다.

예를 들어 AES-256-XTS에서 512-byte와 4096-byte data unit을 지원하면 /sys/block/<disk>/queue/crypto/modes/AES-256-XTS가 존재하고 0x1200을 담는다. 이 crypto 항목들의 contact는 linux-block@vger.kernel.org다.

DAX, discard와 independent access range

311-426
경로작성 시점·접근의미
/sys/block/<disk>/queue/dax2016년 6월 · read-onlyCPU-addressable storage가 page cache를 우회하는 Direct Access(DAX)를 지원하면 1, 아니면 0이다.
/sys/block/<disk>/queue/discard_granularity2011년 5월 · read-onlyDevice가 보고한 내부 allocation unit 크기를 byte로 나타낸다. 보고하지 않으면 physical block size와 같게 설정한다. 0이면 discard를 지원하지 않는다.
/sys/block/<disk>/queue/discard_max_bytes2011년 5월 · read/writediscard_max_hw_bytes가 hardware limit인 반면 이 값은 software limit이다. 큰 discard에서 latency가 큰 device는 값을 낮춰 Linux가 더 작은 discard를 발행하게 하면 latency를 줄일 수 있다.
/sys/block/<disk>/queue/discard_max_hw_bytes2015년 7월 · read-onlyDevice driver가 설정한 한 번의 operation에서 discard할 수 있는 최대 byte 수다. Device에 보내는 request가 넘으면 안 된다. 0이면 discard를 지원하지 않는다.
/sys/block/<disk>/queue/discard_zeroes_data2011년 5월 · read-only항상 0을 반환한다. Discard의 특정 동작에 의존해서는 안 되며 이 file을 읽지 말아야 한다.
/sys/block/<disk>/queue/dma_alignment2022년 5월O_DIRECT raw block access와 driver별 passthrough mechanism에 쓸 user space address가 만족해야 하는 alignment를 보고한다.
/sys/block/<disk>/queue/fua2018년 5월 · read-onlyBlock driver가 write request의 FUA(Force Unit Access) flag를 지원하는지 나타낸다. FUA가 설정되면 write가 storage device의 volatile cache를 우회해야 한다.
/sys/block/<disk>/queue/hw_sector_size2008년 1월 · read-onlyDevice hardware sector size를 byte로 나타낸다.

independent_access_ranges/

2021년 10월에 추가된 read-only subdirectory로 contact는 linux-block@vger.kernel.org다. 이 directory가 있으면 서로 다른 sector range를 대상으로 하는 request를 병렬 실행할 수 있다. 예를 들어 single-LUN multi-actuator HDD가 actuator의 sector range를 올바르게 알리면 이 directory가 생긴다.

Access range마다 directory 하나가 있고 sector file은 첫 sector, nr_sectors file은 그 지점부터의 전체 sector 수를 나타낸다. 두 값은 실제 block size와 관계없이 512B sector 단위를 쓴다. Range는 겹치지 않고 device capacity의 모든 sector를 포함한다. 시작 sector가 증가하는 순서로 번호를 붙이므로 range 0의 sector 값은 항상 0이다.

Dual-actuator independent access range
range 0range 1
01 sector = 0sector = range 1 시작 sector
02 nr_sectors = range 0 길이nr_sectors = range 1 길이
03 actuator 0가 독립 처리actuator 1이 독립 처리

원문의 ASCII directory tree를 두 독립 sector range와 각 attribute의 관계로 다시 그렸습니다.

Polling, timeout, accounting과 queue limit

429-540
경로작성 시점·접근의미
/sys/block/<disk>/queue/io_poll2015년 11월 · read/write읽으면 polling 활성화는 1, 비활성화는 0이다. 0을 쓰면 끄고 0이 아닌 값을 쓰면 켠다.
/sys/block/<disk>/queue/io_poll_delay2016년 11월 · read/write · deprecated과거 polling 종류를 제어했으나 현재 -1, classic polling으로 고정된다. CPU가 시간을 양보하지 않고 completion을 반복 확인한다.
/sys/block/<disk>/queue/io_timeout2018년 11월 · read/writeRequest timeout을 millisecond로 나타낸다. 이 시간 안에 완료되지 않으면 driver timeout handler가 retry, fail 또는 device recovery strategy 시작을 결정한다.
/sys/block/<disk>/queue/iostats2009년 1월 · read/writeDisk I/O statistics accounting을 켜거나 끈다.
/sys/block/<disk>/queue/iostats_passthrough2024년 10월 · read/writePassthrough command의 disk I/O statistics accounting을 켜거나 끈다.
/sys/block/<disk>/queue/logical_block_size2009년 5월 · read-onlyStorage device가 address할 수 있는 가장 작은 단위이며 일반적으로 512 byte다.
/sys/block/<disk>/queue/max_active_zones2020년 7월 · read-onlyHost-managed 또는 host-aware zoned device에서 EXPLICIT OPEN, IMPLICIT OPEN, CLOSED 상태 zone 수의 합을 제한한다. 0이면 제한이 없다. Host가 초과하면 driver는 BLK_STS_ZONE_ACTIVE_RESOURCE를 보고해야 하며 user space에는 EOVERFLOW errno로 보일 수 있다.
/sys/block/<disk>/queue/max_discard_segments2017년 2월 · read-onlyDiscard request의 최대 DMA scatter/gather entry 수다.
/sys/block/<disk>/queue/max_hw_sectors_kb2004년 9월 · read-only한 번의 data transfer에서 hardware가 지원하는 최대 kilobyte 수다.
/sys/block/<disk>/queue/max_integrity_segments2010년 9월 · read-onlyBlock layer core가 driver에 제출하는 integrity data 포함 DMA scatter/gather list의 최대 element 수다.
/sys/block/<disk>/queue/max_open_zones2020년 7월 · read-onlyZoned device에서 EXPLICIT OPEN 또는 IMPLICIT OPEN 상태 zone 수의 합을 제한한다. 0이면 제한이 없다.
/sys/block/<disk>/queue/max_sectors_kb2004년 9월 · read/writeBlock layer가 filesystem request에 허용하는 최대 kilobyte 수다. Hardware 최대 크기 이하여야 하며 0을 쓰면 kernel 기본값을 사용한다.

별도 담당자가 적힌 io_timeout과 zoned limit을 제외한 이 구간의 contact는 linux-block@vger.kernel.org이며, logical_block_size 담당자는 Martin K. Petersen다.

Segment, request, I/O 크기와 completion affinity

543-678
경로작성 시점·접근의미
/sys/block/<disk>/queue/max_segment_size2010년 3월 · read-onlyDMA scatter/gather list element 하나의 최대 byte 크기다.
/sys/block/<disk>/queue/max_write_streams2024년 11월 · read-only지원하는 최대 write stream 수이며 미지원이면 0이다. 지원 시 유효한 값은 1부터 max_write_streams까지다.
/sys/block/<disk>/queue/write_stream_granularity2024년 11월 · read-onlyWrite stream의 byte 단위 granularity다. Device 내부 write amplification을 피하려면 함께 discard하거나 overwrite해야 하는 크기다.
/sys/block/<disk>/queue/max_segments2010년 3월 · read-only연결된 block driver에 제출하는 DMA scatter/gather list의 최대 element 수다.
/sys/block/<disk>/queue/minimum_io_size2009년 4월 · read-only성능 penalty 없이 처리할 수 있는 선호 최소 request 크기다. Disk에서는 흔히 physical block size, RAID에서는 stripe chunk size다. IOPS가 중요한 workload는 올바르게 정렬된 minimum_io_size 배수를 선호한다.
/sys/block/<disk>/queue/nomerges2010년 1월 · read/write0은 모든 merge 시도, 1은 복잡한 검사만 끄고 직전 request와의 단순 one-shot merge 유지, 2는 모든 merge 시도를 끈다. 알려진 random I/O에서는 실패할 merge 검사의 CPU cycle을 줄일 수 있다.
/sys/block/<disk>/queue/nr_requests2003년 7월 · read/writeBlock layer에서 할당할 수 있는 request 수다. 값은 blk_mq_tags instance 하나의 수만 나타내며 전체 device 수는 hardware queue 수, elevator 활성화, tag 공유 여부에 따라 달라진다.
/sys/block/<disk>/queue/nr_zones2018년 11월 · read-onlyHost-aware 또는 host-managed zoned block device의 전체 zone 수다. 일반 block device에서는 항상 0이다.
/sys/block/<disk>/queue/optimal_io_size2009년 4월 · read-only지속 I/O에 선호하는 단위다. Disk drive는 드물게 보고하며 RAID에서는 보통 stripe width 또는 내부 track size다. Sustained throughput workload는 올바르게 정렬된 배수를 선호한다. 보고하지 않으면 0이다.
/sys/block/<disk>/queue/physical_block_size2009년 5월 · read-onlyPhysical storage가 원자적으로 쓸 수 있는 가장 작은 단위다. 보통 logical block과 같지만 4KB sector를 512-byte logical block으로 노출하는 SATA drive처럼 더 클 수 있다. Stacked device에서는 component의 최댓값이다.
/sys/block/<disk>/queue/read_ahead_kb2004년 5월 · read/write이 block device의 filesystem에 적용하는 최대 readahead kilobyte 수다. MADV_HUGEPAGE는 hugepage 크기를 granularity로 사용하므로 이 값을 넘을 수 있다.
/sys/block/<disk>/queue/rotational2009년 1월 · read/writeDevice가 rotational인지 non-rotational인지 나타내는 데 사용한다.
/sys/block/<disk>/queue/rq_affinity2008년 9월 · read/write1이면 completion을 request를 제출한 CPU group으로 이동해 cache 효과로 CPU cycle을 줄일 수 있다. 2이면 group aggregation을 우회하고 요청 CPU에서 completion을 실행해 처리 분산을 극대화한다.

minimum_io_size, optimal_io_size, physical_block_size의 담당자는 Martin K. Petersen이며, 나머지 항목의 contact는 linux-block@vger.kernel.org다. nr_zones 담당자는 Damien Le Moal이다.

Scheduler, stable write, throttling과 cache

681-746
경로작성 시점·접근의미
/sys/block/<disk>/queue/scheduler2004년 10월 · read/write현재 및 사용 가능한 I/O scheduler를 표시하며 활성 scheduler는 []로 감싼다. Scheduler 이름을 쓰면 전환하고 module이 없으면 load를 시도한다.
/sys/block/<disk>/queue/stable_writes2020년 9월 · read/writeWrite request가 memory를 여러 번 읽어 매번 같은 data를 봐야 하면 1이다. 예를 들어 checksum 계산 뒤 실제 write를 수행할 때 kernel은 page writeback이 끝나기 전 수정을 막는다. 제약이 없으면 0이며 test 목적으로 쓸 수 있다.
/sys/block/<disk>/queue/virt_boundary_mask2021년 4월 · read-onlyI/O segment memory alignment mask다. 이전 segment 끝 또는 현재 segment 시작 memory address가 virt_boundary_mask + 1 byte에 정렬되지 않은 지점에서 request를 분할한다.
/sys/block/<disk>/queue/wbt_lat_usec2016년 11월 · read/writeWriteback throttling 등록 device의 목표 최소 read latency다. 일정 window에서 초과하면 write를 줄이기 시작한다. 0은 기능을 끄고 -1은 기본값으로 reset한다. Window는 curr_win_nsec를 참조한다.
/sys/block/<disk>/queue/write_cache2016년 4월 · read/writeWrite-back cache 활성화 시 write back, 아니면 write through를 반환한다. 쓰기는 kernel이 보는 상태만 바꾸고 device 상태는 바꾸지 않는다. write back에서 write through로 바꾸면 kernel cache flush도 사라지므로 안전하지 않을 수 있다.

이 구간의 contact는 linux-block@vger.kernel.org다.

Write same, zeroing, zoned storage와 통계

749-881
경로작성 시점·접근의미
/sys/block/<disk>/queue/write_same_max_bytes2012년 1월 · read-onlyData block 하나를 연속 block range에 쓰는 write same command의 최대 byte 수다. Disk 영역 삭제나 RAID drive 초기화에 쓸 수 있으며 0이면 미지원이다.
/sys/block/<disk>/queue/write_zeroes_max_bytes2016년 11월 · read-onlyPayload 없이 연속 block range를 zero로 만드는 write zeroes command의 최대 byte 수다. 0이면 미지원이다.
/sys/block/<disk>/queue/write_zeroes_unmap_max_hw_bytes2025년 1월 · read-only각 block에 zero를 물리적으로 쓰는 비용을 피할 수 있는 hardware capability다. write_zeroes_max_bytes와 같으면 이후 read가 zero를 반환함을 보장하면서 media write를 기회적으로 피한다. Misalignment나 내부 allocation unit보다 작은 range에서는 실제 zero write로 fallback할 수 있다. 0이면 각 logical block을 실제로 써야 할 수 있다.
/sys/block/<disk>/queue/write_zeroes_unmap_max_bytes2025년 1월 · read/writeHardware limit에 대응하는 software limit이다. Best-effort라 속도는 보장되지 않는다. 0은 기능을 끄며 그 밖에는 write_zeroes_unmap_max_hw_bytes와 같아야 한다.
/sys/block/<disk>/queue/zone_append_max_bytes2020년 5월 · read-onlyREQ_OP_ZONE_APPEND로 zoned device의 sequential zone에 쓸 수 있는 최대 byte 수다. 일반 block device에서는 항상 0이다.
/sys/block/<disk>/queue/zone_write_granularity2021년 1월 · read-onlyHost-managed 또는 host-aware device의 sequential zone write가 만족해야 하는 byte 단위 alignment다. 일반 device에서는 0이다.
/sys/block/<disk>/queue/zoned2016년 9월 · read-only일반 device는 none, zoned device는 host-aware 또는 host-managed를 반환한다. ZBC와 ZAC standard가 두 model을 정의한다. drive-managed model은 zone command를 지원하지 않아 일반 device로 취급하고 none을 반환한다.
/sys/block/<disk>/hidden2023년 3월 · read-only숨겨진 block device다. Event를 만들지 않고 user space나 blkdev_get*으로 열 수 없다. Multipath device의 underlying component에 사용한다.

write_same_max_bytes 담당자는 Martin K. Petersen, write_zeroes_max_bytes는 Chaitanya Kulkarni, 두 unmap 항목은 Zhang Yi, zoned는 Damien Le Moal이며 나머지는 linux-block@vger.kernel.org다.

/sys/block/<disk>/stat

2008년 2월에 추가됐고 담당자는 Jerome Marchand다. Disk I/O 통계를 표시한다. 원문 설명은 11개 field라고 적지만 이어지는 표에는 다음 17개 field가 정의돼 있다.

번호통계
1성공적으로 완료된 read
2merge된 read
3읽은 sector
4read에 사용한 시간(ms)
5완료된 write
6merge된 write
7쓴 sector
8write에 사용한 시간(ms)
9현재 진행 중인 I/O
10I/O 수행에 사용한 시간(ms)
11I/O 수행에 사용한 가중 시간(ms)
12완료된 discard
13merge된 discard
14discard한 sector
15discard에 사용한 시간(ms)
16완료된 flush request
17flush에 사용한 시간(ms)

자세한 내용은 Documentation/admin-guide/iostats.rst를 참조한다.