107c9093cSEric BiggersWhat:		/sys/block/<disk>/alignment_offset
207c9093cSEric BiggersDate:		April 2009
307c9093cSEric BiggersContact:	Martin K. Petersen <martin.petersen@oracle.com>
407c9093cSEric BiggersDescription:
507c9093cSEric Biggers		Storage devices may report a physical block size that is
607c9093cSEric Biggers		bigger than the logical block size (for instance a drive
707c9093cSEric Biggers		with 4KB physical sectors exposing 512-byte logical
807c9093cSEric Biggers		blocks to the operating system).  This parameter
907c9093cSEric Biggers		indicates how many bytes the beginning of the device is
1007c9093cSEric Biggers		offset from the disk's natural alignment.
1107c9093cSEric Biggers
1207c9093cSEric Biggers
1307c9093cSEric BiggersWhat:		/sys/block/<disk>/discard_alignment
1407c9093cSEric BiggersDate:		May 2011
1507c9093cSEric BiggersContact:	Martin K. Petersen <martin.petersen@oracle.com>
1607c9093cSEric BiggersDescription:
1707c9093cSEric Biggers		Devices that support discard functionality may
1807c9093cSEric Biggers		internally allocate space in units that are bigger than
1907c9093cSEric Biggers		the exported logical block size. The discard_alignment
2007c9093cSEric Biggers		parameter indicates how many bytes the beginning of the
2107c9093cSEric Biggers		device is offset from the internal allocation unit's
2207c9093cSEric Biggers		natural alignment.
2307c9093cSEric Biggers
2407c9093cSEric Biggers
2507c9093cSEric BiggersWhat:		/sys/block/<disk>/diskseq
2607c9093cSEric BiggersDate:		February 2021
2707c9093cSEric BiggersContact:	Matteo Croce <mcroce@microsoft.com>
2807c9093cSEric BiggersDescription:
2907c9093cSEric Biggers		The /sys/block/<disk>/diskseq files reports the disk
3007c9093cSEric Biggers		sequence number, which is a monotonically increasing
3107c9093cSEric Biggers		number assigned to every drive.
3207c9093cSEric Biggers		Some devices, like the loop device, refresh such number
3307c9093cSEric Biggers		every time the backing file is changed.
3407c9093cSEric Biggers		The value type is 64 bit unsigned.
3507c9093cSEric Biggers
3607c9093cSEric Biggers
3707c9093cSEric BiggersWhat:		/sys/block/<disk>/inflight
3807c9093cSEric BiggersDate:		October 2009
3907c9093cSEric BiggersContact:	Jens Axboe <axboe@kernel.dk>, Nikanth Karthikesan <knikanth@suse.de>
4007c9093cSEric BiggersDescription:
4107c9093cSEric Biggers		Reports the number of I/O requests currently in progress
4207c9093cSEric Biggers		(pending / in flight) in a device driver. This can be less
4307c9093cSEric Biggers		than the number of requests queued in the block device queue.
4407c9093cSEric Biggers		The report contains 2 fields: one for read requests
4507c9093cSEric Biggers		and one for write requests.
4607c9093cSEric Biggers		The value type is unsigned int.
4707c9093cSEric Biggers		Cf. Documentation/block/stat.rst which contains a single value for
4807c9093cSEric Biggers		requests in flight.
49*849ab826SEric Biggers		This is related to /sys/block/<disk>/queue/nr_requests
5007c9093cSEric Biggers		and for SCSI device also its queue_depth.
5107c9093cSEric Biggers
5207c9093cSEric Biggers
5307c9093cSEric BiggersWhat:		/sys/block/<disk>/integrity/device_is_integrity_capable
5407c9093cSEric BiggersDate:		July 2014
5507c9093cSEric BiggersContact:	Martin K. Petersen <martin.petersen@oracle.com>
5607c9093cSEric BiggersDescription:
5707c9093cSEric Biggers		Indicates whether a storage device is capable of storing
5807c9093cSEric Biggers		integrity metadata. Set if the device is T10 PI-capable.
5907c9093cSEric Biggers
6007c9093cSEric Biggers
6107c9093cSEric BiggersWhat:		/sys/block/<disk>/integrity/format
6207c9093cSEric BiggersDate:		June 2008
6307c9093cSEric BiggersContact:	Martin K. Petersen <martin.petersen@oracle.com>
6407c9093cSEric BiggersDescription:
6507c9093cSEric Biggers		Metadata format for integrity capable block device.
6607c9093cSEric Biggers		E.g. T10-DIF-TYPE1-CRC.
6707c9093cSEric Biggers
6807c9093cSEric Biggers
6907c9093cSEric BiggersWhat:		/sys/block/<disk>/integrity/protection_interval_bytes
7007c9093cSEric BiggersDate:		July 2015
7107c9093cSEric BiggersContact:	Martin K. Petersen <martin.petersen@oracle.com>
7207c9093cSEric BiggersDescription:
7307c9093cSEric Biggers		Describes the number of data bytes which are protected
7407c9093cSEric Biggers		by one integrity tuple. Typically the device's logical
7507c9093cSEric Biggers		block size.
7607c9093cSEric Biggers
7707c9093cSEric Biggers
7807c9093cSEric BiggersWhat:		/sys/block/<disk>/integrity/read_verify
7907c9093cSEric BiggersDate:		June 2008
8007c9093cSEric BiggersContact:	Martin K. Petersen <martin.petersen@oracle.com>
8107c9093cSEric BiggersDescription:
8207c9093cSEric Biggers		Indicates whether the block layer should verify the
8307c9093cSEric Biggers		integrity of read requests serviced by devices that
8407c9093cSEric Biggers		support sending integrity metadata.
8507c9093cSEric Biggers
8607c9093cSEric Biggers
8707c9093cSEric BiggersWhat:		/sys/block/<disk>/integrity/tag_size
8807c9093cSEric BiggersDate:		June 2008
8907c9093cSEric BiggersContact:	Martin K. Petersen <martin.petersen@oracle.com>
9007c9093cSEric BiggersDescription:
9107c9093cSEric Biggers		Number of bytes of integrity tag space available per
9207c9093cSEric Biggers		512 bytes of data.
9307c9093cSEric Biggers
9407c9093cSEric Biggers
9507c9093cSEric BiggersWhat:		/sys/block/<disk>/integrity/write_generate
9607c9093cSEric BiggersDate:		June 2008
9707c9093cSEric BiggersContact:	Martin K. Petersen <martin.petersen@oracle.com>
9807c9093cSEric BiggersDescription:
9907c9093cSEric Biggers		Indicates whether the block layer should automatically
10007c9093cSEric Biggers		generate checksums for write requests bound for
10107c9093cSEric Biggers		devices that support receiving integrity metadata.
10207c9093cSEric Biggers
10307c9093cSEric Biggers
10407c9093cSEric BiggersWhat:		/sys/block/<disk>/<partition>/alignment_offset
10507c9093cSEric BiggersDate:		April 2009
10607c9093cSEric BiggersContact:	Martin K. Petersen <martin.petersen@oracle.com>
10707c9093cSEric BiggersDescription:
10807c9093cSEric Biggers		Storage devices may report a physical block size that is
10907c9093cSEric Biggers		bigger than the logical block size (for instance a drive
11007c9093cSEric Biggers		with 4KB physical sectors exposing 512-byte logical
11107c9093cSEric Biggers		blocks to the operating system).  This parameter
11207c9093cSEric Biggers		indicates how many bytes the beginning of the partition
11307c9093cSEric Biggers		is offset from the disk's natural alignment.
11407c9093cSEric Biggers
11507c9093cSEric Biggers
11607c9093cSEric BiggersWhat:		/sys/block/<disk>/<partition>/discard_alignment
11707c9093cSEric BiggersDate:		May 2011
11807c9093cSEric BiggersContact:	Martin K. Petersen <martin.petersen@oracle.com>
11907c9093cSEric BiggersDescription:
12007c9093cSEric Biggers		Devices that support discard functionality may
12107c9093cSEric Biggers		internally allocate space in units that are bigger than
12207c9093cSEric Biggers		the exported logical block size. The discard_alignment
12307c9093cSEric Biggers		parameter indicates how many bytes the beginning of the
12407c9093cSEric Biggers		partition is offset from the internal allocation unit's
12507c9093cSEric Biggers		natural alignment.
12607c9093cSEric Biggers
12707c9093cSEric Biggers
12807c9093cSEric BiggersWhat:		/sys/block/<disk>/<partition>/stat
12907c9093cSEric BiggersDate:		February 2008
13007c9093cSEric BiggersContact:	Jerome Marchand <jmarchan@redhat.com>
13107c9093cSEric BiggersDescription:
13207c9093cSEric Biggers		The /sys/block/<disk>/<partition>/stat files display the
13307c9093cSEric Biggers		I/O statistics of partition <partition>. The format is the
13407c9093cSEric Biggers		same as the format of /sys/block/<disk>/stat.
13507c9093cSEric Biggers
13607c9093cSEric Biggers
137*849ab826SEric BiggersWhat:		/sys/block/<disk>/queue/add_random
138*849ab826SEric BiggersDate:		June 2010
139*849ab826SEric BiggersContact:	linux-block@vger.kernel.org
140*849ab826SEric BiggersDescription:
141*849ab826SEric Biggers		[RW] This file allows to turn off the disk entropy contribution.
142*849ab826SEric Biggers		Default value of this file is '1'(on).
143*849ab826SEric Biggers
144*849ab826SEric Biggers
14507c9093cSEric BiggersWhat:		/sys/block/<disk>/queue/chunk_sectors
14607c9093cSEric BiggersDate:		September 2016
14707c9093cSEric BiggersContact:	Hannes Reinecke <hare@suse.com>
14807c9093cSEric BiggersDescription:
149*849ab826SEric Biggers		[RO] chunk_sectors has different meaning depending on the type
15007c9093cSEric Biggers		of the disk. For a RAID device (dm-raid), chunk_sectors
151*849ab826SEric Biggers		indicates the size in 512B sectors of the RAID volume stripe
152*849ab826SEric Biggers		segment. For a zoned block device, either host-aware or
153*849ab826SEric Biggers		host-managed, chunk_sectors indicates the size in 512B sectors
154*849ab826SEric Biggers		of the zones of the device, with the eventual exception of the
155*849ab826SEric Biggers		last zone of the device which may be smaller.
156*849ab826SEric Biggers
157*849ab826SEric Biggers
158*849ab826SEric BiggersWhat:		/sys/block/<disk>/queue/dax
159*849ab826SEric BiggersDate:		June 2016
160*849ab826SEric BiggersContact:	linux-block@vger.kernel.org
161*849ab826SEric BiggersDescription:
162*849ab826SEric Biggers		[RO] This file indicates whether the device supports Direct
163*849ab826SEric Biggers		Access (DAX), used by CPU-addressable storage to bypass the
164*849ab826SEric Biggers		pagecache.  It shows '1' if true, '0' if not.
16507c9093cSEric Biggers
16607c9093cSEric Biggers
16707c9093cSEric BiggersWhat:		/sys/block/<disk>/queue/discard_granularity
16807c9093cSEric BiggersDate:		May 2011
16907c9093cSEric BiggersContact:	Martin K. Petersen <martin.petersen@oracle.com>
17007c9093cSEric BiggersDescription:
171*849ab826SEric Biggers		[RO] Devices that support discard functionality may internally
172*849ab826SEric Biggers		allocate space using units that are bigger than the logical
173*849ab826SEric Biggers		block size. The discard_granularity parameter indicates the size
174*849ab826SEric Biggers		of the internal allocation unit in bytes if reported by the
175*849ab826SEric Biggers		device. Otherwise the discard_granularity will be set to match
176*849ab826SEric Biggers		the device's physical block size. A discard_granularity of 0
177*849ab826SEric Biggers		means that the device does not support discard functionality.
17807c9093cSEric Biggers
17907c9093cSEric Biggers
18007c9093cSEric BiggersWhat:		/sys/block/<disk>/queue/discard_max_bytes
18107c9093cSEric BiggersDate:		May 2011
18207c9093cSEric BiggersContact:	Martin K. Petersen <martin.petersen@oracle.com>
18307c9093cSEric BiggersDescription:
184*849ab826SEric Biggers		[RW] While discard_max_hw_bytes is the hardware limit for the
185*849ab826SEric Biggers		device, this setting is the software limit. Some devices exhibit
186*849ab826SEric Biggers		large latencies when large discards are issued, setting this
187*849ab826SEric Biggers		value lower will make Linux issue smaller discards and
188*849ab826SEric Biggers		potentially help reduce latencies induced by large discard
189*849ab826SEric Biggers		operations.
190*849ab826SEric Biggers
191*849ab826SEric Biggers
192*849ab826SEric BiggersWhat:		/sys/block/<disk>/queue/discard_max_hw_bytes
193*849ab826SEric BiggersDate:		July 2015
194*849ab826SEric BiggersContact:	linux-block@vger.kernel.org
195*849ab826SEric BiggersDescription:
196*849ab826SEric Biggers		[RO] Devices that support discard functionality may have
197*849ab826SEric Biggers		internal limits on the number of bytes that can be trimmed or
198*849ab826SEric Biggers		unmapped in a single operation.  The `discard_max_hw_bytes`
199*849ab826SEric Biggers		parameter is set by the device driver to the maximum number of
200*849ab826SEric Biggers		bytes that can be discarded in a single operation.  Discard
201*849ab826SEric Biggers		requests issued to the device must not exceed this limit.  A
202*849ab826SEric Biggers		`discard_max_hw_bytes` value of 0 means that the device does not
203*849ab826SEric Biggers		support discard functionality.
20407c9093cSEric Biggers
20507c9093cSEric Biggers
20607c9093cSEric BiggersWhat:		/sys/block/<disk>/queue/discard_zeroes_data
20707c9093cSEric BiggersDate:		May 2011
20807c9093cSEric BiggersContact:	Martin K. Petersen <martin.petersen@oracle.com>
20907c9093cSEric BiggersDescription:
210*849ab826SEric Biggers		[RO] Will always return 0.  Don't rely on any specific behavior
21107c9093cSEric Biggers		for discards, and don't read this file.
21207c9093cSEric Biggers
21307c9093cSEric Biggers
214*849ab826SEric BiggersWhat:		/sys/block/<disk>/queue/fua
215*849ab826SEric BiggersDate:		May 2018
216*849ab826SEric BiggersContact:	linux-block@vger.kernel.org
217*849ab826SEric BiggersDescription:
218*849ab826SEric Biggers		[RO] Whether or not the block driver supports the FUA flag for
219*849ab826SEric Biggers		write requests.  FUA stands for Force Unit Access. If the FUA
220*849ab826SEric Biggers		flag is set that means that write requests must bypass the
221*849ab826SEric Biggers		volatile cache of the storage device.
222*849ab826SEric Biggers
223*849ab826SEric Biggers
224*849ab826SEric BiggersWhat:		/sys/block/<disk>/queue/hw_sector_size
225*849ab826SEric BiggersDate:		January 2008
226*849ab826SEric BiggersContact:	linux-block@vger.kernel.org
227*849ab826SEric BiggersDescription:
228*849ab826SEric Biggers		[RO] This is the hardware sector size of the device, in bytes.
229*849ab826SEric Biggers
230*849ab826SEric Biggers
231*849ab826SEric BiggersWhat:		/sys/block/<disk>/queue/independent_access_ranges/
232*849ab826SEric BiggersDate:		October 2021
233*849ab826SEric BiggersContact:	linux-block@vger.kernel.org
234*849ab826SEric BiggersDescription:
235*849ab826SEric Biggers		[RO] The presence of this sub-directory of the
236*849ab826SEric Biggers		/sys/block/xxx/queue/ directory indicates that the device is
237*849ab826SEric Biggers		capable of executing requests targeting different sector ranges
238*849ab826SEric Biggers		in parallel. For instance, single LUN multi-actuator hard-disks
239*849ab826SEric Biggers		will have an independent_access_ranges directory if the device
240*849ab826SEric Biggers		correctly advertizes the sector ranges of its actuators.
241*849ab826SEric Biggers
242*849ab826SEric Biggers		The independent_access_ranges directory contains one directory
243*849ab826SEric Biggers		per access range, with each range described using the sector
244*849ab826SEric Biggers		(RO) attribute file to indicate the first sector of the range
245*849ab826SEric Biggers		and the nr_sectors (RO) attribute file to indicate the total
246*849ab826SEric Biggers		number of sectors in the range starting from the first sector of
247*849ab826SEric Biggers		the range.  For example, a dual-actuator hard-disk will have the
248*849ab826SEric Biggers		following independent_access_ranges entries.::
249*849ab826SEric Biggers
250*849ab826SEric Biggers			$ tree /sys/block/<disk>/queue/independent_access_ranges/
251*849ab826SEric Biggers			/sys/block/<disk>/queue/independent_access_ranges/
252*849ab826SEric Biggers			|-- 0
253*849ab826SEric Biggers			|   |-- nr_sectors
254*849ab826SEric Biggers			|   `-- sector
255*849ab826SEric Biggers			`-- 1
256*849ab826SEric Biggers			    |-- nr_sectors
257*849ab826SEric Biggers			    `-- sector
258*849ab826SEric Biggers
259*849ab826SEric Biggers		The sector and nr_sectors attributes use 512B sector unit,
260*849ab826SEric Biggers		regardless of the actual block size of the device. Independent
261*849ab826SEric Biggers		access ranges do not overlap and include all sectors within the
262*849ab826SEric Biggers		device capacity. The access ranges are numbered in increasing
263*849ab826SEric Biggers		order of the range start sector, that is, the sector attribute
264*849ab826SEric Biggers		of range 0 always has the value 0.
265*849ab826SEric Biggers
266*849ab826SEric Biggers
267*849ab826SEric BiggersWhat:		/sys/block/<disk>/queue/io_poll
268*849ab826SEric BiggersDate:		November 2015
269*849ab826SEric BiggersContact:	linux-block@vger.kernel.org
270*849ab826SEric BiggersDescription:
271*849ab826SEric Biggers		[RW] When read, this file shows whether polling is enabled (1)
272*849ab826SEric Biggers		or disabled (0).  Writing '0' to this file will disable polling
273*849ab826SEric Biggers		for this device.  Writing any non-zero value will enable this
274*849ab826SEric Biggers		feature.
275*849ab826SEric Biggers
276*849ab826SEric Biggers
277*849ab826SEric BiggersWhat:		/sys/block/<disk>/queue/io_poll_delay
278*849ab826SEric BiggersDate:		November 2016
279*849ab826SEric BiggersContact:	linux-block@vger.kernel.org
280*849ab826SEric BiggersDescription:
281*849ab826SEric Biggers		[RW] If polling is enabled, this controls what kind of polling
282*849ab826SEric Biggers		will be performed. It defaults to -1, which is classic polling.
283*849ab826SEric Biggers		In this mode, the CPU will repeatedly ask for completions
284*849ab826SEric Biggers		without giving up any time.  If set to 0, a hybrid polling mode
285*849ab826SEric Biggers		is used, where the kernel will attempt to make an educated guess
286*849ab826SEric Biggers		at when the IO will complete. Based on this guess, the kernel
287*849ab826SEric Biggers		will put the process issuing IO to sleep for an amount of time,
288*849ab826SEric Biggers		before entering a classic poll loop. This mode might be a little
289*849ab826SEric Biggers		slower than pure classic polling, but it will be more efficient.
290*849ab826SEric Biggers		If set to a value larger than 0, the kernel will put the process
291*849ab826SEric Biggers		issuing IO to sleep for this amount of microseconds before
292*849ab826SEric Biggers		entering classic polling.
293*849ab826SEric Biggers
294*849ab826SEric Biggers
29507c9093cSEric BiggersWhat:		/sys/block/<disk>/queue/io_timeout
29607c9093cSEric BiggersDate:		November 2018
29707c9093cSEric BiggersContact:	Weiping Zhang <zhangweiping@didiglobal.com>
29807c9093cSEric BiggersDescription:
299*849ab826SEric Biggers		[RW] io_timeout is the request timeout in milliseconds. If a
300*849ab826SEric Biggers		request does not complete in this time then the block driver
301*849ab826SEric Biggers		timeout handler is invoked. That timeout handler can decide to
302*849ab826SEric Biggers		retry the request, to fail it or to start a device recovery
303*849ab826SEric Biggers		strategy.
304*849ab826SEric Biggers
305*849ab826SEric Biggers
306*849ab826SEric BiggersWhat:		/sys/block/<disk>/queue/iostats
307*849ab826SEric BiggersDate:		January 2009
308*849ab826SEric BiggersContact:	linux-block@vger.kernel.org
309*849ab826SEric BiggersDescription:
310*849ab826SEric Biggers		[RW] This file is used to control (on/off) the iostats
311*849ab826SEric Biggers		accounting of the disk.
31207c9093cSEric Biggers
31307c9093cSEric Biggers
31407c9093cSEric BiggersWhat:		/sys/block/<disk>/queue/logical_block_size
31507c9093cSEric BiggersDate:		May 2009
31607c9093cSEric BiggersContact:	Martin K. Petersen <martin.petersen@oracle.com>
31707c9093cSEric BiggersDescription:
318*849ab826SEric Biggers		[RO] This is the smallest unit the storage device can address.
319*849ab826SEric Biggers		It is typically 512 bytes.
32007c9093cSEric Biggers
32107c9093cSEric Biggers
32207c9093cSEric BiggersWhat:		/sys/block/<disk>/queue/max_active_zones
32307c9093cSEric BiggersDate:		July 2020
32407c9093cSEric BiggersContact:	Niklas Cassel <niklas.cassel@wdc.com>
32507c9093cSEric BiggersDescription:
326*849ab826SEric Biggers		[RO] For zoned block devices (zoned attribute indicating
32707c9093cSEric Biggers		"host-managed" or "host-aware"), the sum of zones belonging to
32807c9093cSEric Biggers		any of the zone states: EXPLICIT OPEN, IMPLICIT OPEN or CLOSED,
32907c9093cSEric Biggers		is limited by this value. If this value is 0, there is no limit.
33007c9093cSEric Biggers
331*849ab826SEric Biggers		If the host attempts to exceed this limit, the driver should
332*849ab826SEric Biggers		report this error with BLK_STS_ZONE_ACTIVE_RESOURCE, which user
333*849ab826SEric Biggers		space may see as the EOVERFLOW errno.
334*849ab826SEric Biggers
335*849ab826SEric Biggers
336*849ab826SEric BiggersWhat:		/sys/block/<disk>/queue/max_discard_segments
337*849ab826SEric BiggersDate:		February 2017
338*849ab826SEric BiggersContact:	linux-block@vger.kernel.org
339*849ab826SEric BiggersDescription:
340*849ab826SEric Biggers		[RO] The maximum number of DMA scatter/gather entries in a
341*849ab826SEric Biggers		discard request.
342*849ab826SEric Biggers
343*849ab826SEric Biggers
344*849ab826SEric BiggersWhat:		/sys/block/<disk>/queue/max_hw_sectors_kb
345*849ab826SEric BiggersDate:		September 2004
346*849ab826SEric BiggersContact:	linux-block@vger.kernel.org
347*849ab826SEric BiggersDescription:
348*849ab826SEric Biggers		[RO] This is the maximum number of kilobytes supported in a
349*849ab826SEric Biggers		single data transfer.
350*849ab826SEric Biggers
351*849ab826SEric Biggers
352*849ab826SEric BiggersWhat:		/sys/block/<disk>/queue/max_integrity_segments
353*849ab826SEric BiggersDate:		September 2010
354*849ab826SEric BiggersContact:	linux-block@vger.kernel.org
355*849ab826SEric BiggersDescription:
356*849ab826SEric Biggers		[RO] Maximum number of elements in a DMA scatter/gather list
357*849ab826SEric Biggers		with integrity data that will be submitted by the block layer
358*849ab826SEric Biggers		core to the associated block driver.
359*849ab826SEric Biggers
36007c9093cSEric Biggers
36107c9093cSEric BiggersWhat:		/sys/block/<disk>/queue/max_open_zones
36207c9093cSEric BiggersDate:		July 2020
36307c9093cSEric BiggersContact:	Niklas Cassel <niklas.cassel@wdc.com>
36407c9093cSEric BiggersDescription:
365*849ab826SEric Biggers		[RO] For zoned block devices (zoned attribute indicating
36607c9093cSEric Biggers		"host-managed" or "host-aware"), the sum of zones belonging to
367*849ab826SEric Biggers		any of the zone states: EXPLICIT OPEN or IMPLICIT OPEN, is
368*849ab826SEric Biggers		limited by this value. If this value is 0, there is no limit.
369*849ab826SEric Biggers
370*849ab826SEric Biggers
371*849ab826SEric BiggersWhat:		/sys/block/<disk>/queue/max_sectors_kb
372*849ab826SEric BiggersDate:		September 2004
373*849ab826SEric BiggersContact:	linux-block@vger.kernel.org
374*849ab826SEric BiggersDescription:
375*849ab826SEric Biggers		[RW] This is the maximum number of kilobytes that the block
376*849ab826SEric Biggers		layer will allow for a filesystem request. Must be smaller than
377*849ab826SEric Biggers		or equal to the maximum size allowed by the hardware.
378*849ab826SEric Biggers
379*849ab826SEric Biggers
380*849ab826SEric BiggersWhat:		/sys/block/<disk>/queue/max_segment_size
381*849ab826SEric BiggersDate:		March 2010
382*849ab826SEric BiggersContact:	linux-block@vger.kernel.org
383*849ab826SEric BiggersDescription:
384*849ab826SEric Biggers		[RO] Maximum size in bytes of a single element in a DMA
385*849ab826SEric Biggers		scatter/gather list.
386*849ab826SEric Biggers
387*849ab826SEric Biggers
388*849ab826SEric BiggersWhat:		/sys/block/<disk>/queue/max_segments
389*849ab826SEric BiggersDate:		March 2010
390*849ab826SEric BiggersContact:	linux-block@vger.kernel.org
391*849ab826SEric BiggersDescription:
392*849ab826SEric Biggers		[RO] Maximum number of elements in a DMA scatter/gather list
393*849ab826SEric Biggers		that is submitted to the associated block driver.
39407c9093cSEric Biggers
39507c9093cSEric Biggers
39607c9093cSEric BiggersWhat:		/sys/block/<disk>/queue/minimum_io_size
39707c9093cSEric BiggersDate:		April 2009
39807c9093cSEric BiggersContact:	Martin K. Petersen <martin.petersen@oracle.com>
39907c9093cSEric BiggersDescription:
400*849ab826SEric Biggers		[RO] Storage devices may report a granularity or preferred
401*849ab826SEric Biggers		minimum I/O size which is the smallest request the device can
402*849ab826SEric Biggers		perform without incurring a performance penalty.  For disk
403*849ab826SEric Biggers		drives this is often the physical block size.  For RAID arrays
404*849ab826SEric Biggers		it is often the stripe chunk size.  A properly aligned multiple
405*849ab826SEric Biggers		of minimum_io_size is the preferred request size for workloads
406*849ab826SEric Biggers		where a high number of I/O operations is desired.
40707c9093cSEric Biggers
40807c9093cSEric Biggers
40907c9093cSEric BiggersWhat:		/sys/block/<disk>/queue/nomerges
41007c9093cSEric BiggersDate:		January 2010
4118b0551a7SEric BiggersContact:	linux-block@vger.kernel.org
41207c9093cSEric BiggersDescription:
413*849ab826SEric Biggers		[RW] Standard I/O elevator operations include attempts to merge
414*849ab826SEric Biggers		contiguous I/Os. For known random I/O loads these attempts will
415*849ab826SEric Biggers		always fail and result in extra cycles being spent in the
416*849ab826SEric Biggers		kernel. This allows one to turn off this behavior on one of two
417*849ab826SEric Biggers		ways: When set to 1, complex merge checks are disabled, but the
418*849ab826SEric Biggers		simple one-shot merges with the previous I/O request are
419*849ab826SEric Biggers		enabled. When set to 2, all merge tries are disabled. The
420*849ab826SEric Biggers		default value is 0 - which enables all types of merge tries.
421*849ab826SEric Biggers
422*849ab826SEric Biggers
423*849ab826SEric BiggersWhat:		/sys/block/<disk>/queue/nr_requests
424*849ab826SEric BiggersDate:		July 2003
425*849ab826SEric BiggersContact:	linux-block@vger.kernel.org
426*849ab826SEric BiggersDescription:
427*849ab826SEric Biggers		[RW] This controls how many requests may be allocated in the
428*849ab826SEric Biggers		block layer for read or write requests. Note that the total
429*849ab826SEric Biggers		allocated number may be twice this amount, since it applies only
430*849ab826SEric Biggers		to reads or writes (not the accumulated sum).
431*849ab826SEric Biggers
432*849ab826SEric Biggers		To avoid priority inversion through request starvation, a
433*849ab826SEric Biggers		request queue maintains a separate request pool per each cgroup
434*849ab826SEric Biggers		when CONFIG_BLK_CGROUP is enabled, and this parameter applies to
435*849ab826SEric Biggers		each such per-block-cgroup request pool.  IOW, if there are N
436*849ab826SEric Biggers		block cgroups, each request queue may have up to N request
437*849ab826SEric Biggers		pools, each independently regulated by nr_requests.
43807c9093cSEric Biggers
43907c9093cSEric Biggers
44007c9093cSEric BiggersWhat:		/sys/block/<disk>/queue/nr_zones
44107c9093cSEric BiggersDate:		November 2018
44207c9093cSEric BiggersContact:	Damien Le Moal <damien.lemoal@wdc.com>
44307c9093cSEric BiggersDescription:
444*849ab826SEric Biggers		[RO] nr_zones indicates the total number of zones of a zoned
445*849ab826SEric Biggers		block device ("host-aware" or "host-managed" zone model). For
446*849ab826SEric Biggers		regular block devices, the value is always 0.
44707c9093cSEric Biggers
44807c9093cSEric Biggers
44907c9093cSEric BiggersWhat:		/sys/block/<disk>/queue/optimal_io_size
45007c9093cSEric BiggersDate:		April 2009
45107c9093cSEric BiggersContact:	Martin K. Petersen <martin.petersen@oracle.com>
45207c9093cSEric BiggersDescription:
453*849ab826SEric Biggers		[RO] Storage devices may report an optimal I/O size, which is
454*849ab826SEric Biggers		the device's preferred unit for sustained I/O.  This is rarely
455*849ab826SEric Biggers		reported for disk drives.  For RAID arrays it is usually the
456*849ab826SEric Biggers		stripe width or the internal track size.  A properly aligned
457*849ab826SEric Biggers		multiple of optimal_io_size is the preferred request size for
458*849ab826SEric Biggers		workloads where sustained throughput is desired.  If no optimal
459*849ab826SEric Biggers		I/O size is reported this file contains 0.
46007c9093cSEric Biggers
46107c9093cSEric Biggers
46207c9093cSEric BiggersWhat:		/sys/block/<disk>/queue/physical_block_size
46307c9093cSEric BiggersDate:		May 2009
46407c9093cSEric BiggersContact:	Martin K. Petersen <martin.petersen@oracle.com>
46507c9093cSEric BiggersDescription:
466*849ab826SEric Biggers		[RO] This is the smallest unit a physical storage device can
467*849ab826SEric Biggers		write atomically.  It is usually the same as the logical block
468*849ab826SEric Biggers		size but may be bigger.  One example is SATA drives with 4KB
469*849ab826SEric Biggers		sectors that expose a 512-byte logical block size to the
470*849ab826SEric Biggers		operating system.  For stacked block devices the
471*849ab826SEric Biggers		physical_block_size variable contains the maximum
472*849ab826SEric Biggers		physical_block_size of the component devices.
473*849ab826SEric Biggers
474*849ab826SEric Biggers
475*849ab826SEric BiggersWhat:		/sys/block/<disk>/queue/read_ahead_kb
476*849ab826SEric BiggersDate:		May 2004
477*849ab826SEric BiggersContact:	linux-block@vger.kernel.org
478*849ab826SEric BiggersDescription:
479*849ab826SEric Biggers		[RW] Maximum number of kilobytes to read-ahead for filesystems
480*849ab826SEric Biggers		on this block device.
481*849ab826SEric Biggers
482*849ab826SEric Biggers
483*849ab826SEric BiggersWhat:		/sys/block/<disk>/queue/rotational
484*849ab826SEric BiggersDate:		January 2009
485*849ab826SEric BiggersContact:	linux-block@vger.kernel.org
486*849ab826SEric BiggersDescription:
487*849ab826SEric Biggers		[RW] This file is used to stat if the device is of rotational
488*849ab826SEric Biggers		type or non-rotational type.
489*849ab826SEric Biggers
490*849ab826SEric Biggers
491*849ab826SEric BiggersWhat:		/sys/block/<disk>/queue/rq_affinity
492*849ab826SEric BiggersDate:		September 2008
493*849ab826SEric BiggersContact:	linux-block@vger.kernel.org
494*849ab826SEric BiggersDescription:
495*849ab826SEric Biggers		[RW] If this option is '1', the block layer will migrate request
496*849ab826SEric Biggers		completions to the cpu "group" that originally submitted the
497*849ab826SEric Biggers		request. For some workloads this provides a significant
498*849ab826SEric Biggers		reduction in CPU cycles due to caching effects.
499*849ab826SEric Biggers
500*849ab826SEric Biggers		For storage configurations that need to maximize distribution of
501*849ab826SEric Biggers		completion processing setting this option to '2' forces the
502*849ab826SEric Biggers		completion to run on the requesting cpu (bypassing the "group"
503*849ab826SEric Biggers		aggregation logic).
504*849ab826SEric Biggers
505*849ab826SEric Biggers
506*849ab826SEric BiggersWhat:		/sys/block/<disk>/queue/scheduler
507*849ab826SEric BiggersDate:		October 2004
508*849ab826SEric BiggersContact:	linux-block@vger.kernel.org
509*849ab826SEric BiggersDescription:
510*849ab826SEric Biggers		[RW] When read, this file will display the current and available
511*849ab826SEric Biggers		IO schedulers for this block device. The currently active IO
512*849ab826SEric Biggers		scheduler will be enclosed in [] brackets. Writing an IO
513*849ab826SEric Biggers		scheduler name to this file will switch control of this block
514*849ab826SEric Biggers		device to that new IO scheduler. Note that writing an IO
515*849ab826SEric Biggers		scheduler name to this file will attempt to load that IO
516*849ab826SEric Biggers		scheduler module, if it isn't already present in the system.
517*849ab826SEric Biggers
518*849ab826SEric Biggers
519*849ab826SEric BiggersWhat:		/sys/block/<disk>/queue/throttle_sample_time
520*849ab826SEric BiggersDate:		March 2017
521*849ab826SEric BiggersContact:	linux-block@vger.kernel.org
522*849ab826SEric BiggersDescription:
523*849ab826SEric Biggers		[RW] This is the time window that blk-throttle samples data, in
524*849ab826SEric Biggers		millisecond.  blk-throttle makes decision based on the
525*849ab826SEric Biggers		samplings. Lower time means cgroups have more smooth throughput,
526*849ab826SEric Biggers		but higher CPU overhead. This exists only when
527*849ab826SEric Biggers		CONFIG_BLK_DEV_THROTTLING_LOW is enabled.
528*849ab826SEric Biggers
529*849ab826SEric Biggers
530*849ab826SEric BiggersWhat:		/sys/block/<disk>/queue/wbt_lat_usec
531*849ab826SEric BiggersDate:		November 2016
532*849ab826SEric BiggersContact:	linux-block@vger.kernel.org
533*849ab826SEric BiggersDescription:
534*849ab826SEric Biggers		[RW] If the device is registered for writeback throttling, then
535*849ab826SEric Biggers		this file shows the target minimum read latency. If this latency
536*849ab826SEric Biggers		is exceeded in a given window of time (see wb_window_usec), then
537*849ab826SEric Biggers		the writeback throttling will start scaling back writes. Writing
538*849ab826SEric Biggers		a value of '0' to this file disables the feature. Writing a
539*849ab826SEric Biggers		value of '-1' to this file resets the value to the default
540*849ab826SEric Biggers		setting.
541*849ab826SEric Biggers
542*849ab826SEric Biggers
543*849ab826SEric BiggersWhat:		/sys/block/<disk>/queue/write_cache
544*849ab826SEric BiggersDate:		April 2016
545*849ab826SEric BiggersContact:	linux-block@vger.kernel.org
546*849ab826SEric BiggersDescription:
547*849ab826SEric Biggers		[RW] When read, this file will display whether the device has
548*849ab826SEric Biggers		write back caching enabled or not. It will return "write back"
549*849ab826SEric Biggers		for the former case, and "write through" for the latter. Writing
550*849ab826SEric Biggers		to this file can change the kernels view of the device, but it
551*849ab826SEric Biggers		doesn't alter the device state. This means that it might not be
552*849ab826SEric Biggers		safe to toggle the setting from "write back" to "write through",
553*849ab826SEric Biggers		since that will also eliminate cache flushes issued by the
554*849ab826SEric Biggers		kernel.
55507c9093cSEric Biggers
55607c9093cSEric Biggers
55707c9093cSEric BiggersWhat:		/sys/block/<disk>/queue/write_same_max_bytes
55807c9093cSEric BiggersDate:		January 2012
55907c9093cSEric BiggersContact:	Martin K. Petersen <martin.petersen@oracle.com>
56007c9093cSEric BiggersDescription:
561*849ab826SEric Biggers		[RO] Some devices support a write same operation in which a
56207c9093cSEric Biggers		single data block can be written to a range of several
563*849ab826SEric Biggers		contiguous blocks on storage. This can be used to wipe areas on
564*849ab826SEric Biggers		disk or to initialize drives in a RAID configuration.
565*849ab826SEric Biggers		write_same_max_bytes indicates how many bytes can be written in
566*849ab826SEric Biggers		a single write same command. If write_same_max_bytes is 0, write
567*849ab826SEric Biggers		same is not supported by the device.
56807c9093cSEric Biggers
56907c9093cSEric Biggers
57007c9093cSEric BiggersWhat:		/sys/block/<disk>/queue/write_zeroes_max_bytes
57107c9093cSEric BiggersDate:		November 2016
57207c9093cSEric BiggersContact:	Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
57307c9093cSEric BiggersDescription:
574*849ab826SEric Biggers		[RO] Devices that support write zeroes operation in which a
575*849ab826SEric Biggers		single request can be issued to zero out the range of contiguous
576*849ab826SEric Biggers		blocks on storage without having any payload in the request.
577*849ab826SEric Biggers		This can be used to optimize writing zeroes to the devices.
578*849ab826SEric Biggers		write_zeroes_max_bytes indicates how many bytes can be written
579*849ab826SEric Biggers		in a single write zeroes command. If write_zeroes_max_bytes is
580*849ab826SEric Biggers		0, write zeroes is not supported by the device.
581*849ab826SEric Biggers
582*849ab826SEric Biggers
583*849ab826SEric BiggersWhat:		/sys/block/<disk>/queue/zone_append_max_bytes
584*849ab826SEric BiggersDate:		May 2020
585*849ab826SEric BiggersContact:	linux-block@vger.kernel.org
586*849ab826SEric BiggersDescription:
587*849ab826SEric Biggers		[RO] This is the maximum number of bytes that can be written to
588*849ab826SEric Biggers		a sequential zone of a zoned block device using a zone append
589*849ab826SEric Biggers		write operation (REQ_OP_ZONE_APPEND). This value is always 0 for
590*849ab826SEric Biggers		regular block devices.
591*849ab826SEric Biggers
592*849ab826SEric Biggers
593*849ab826SEric BiggersWhat:		/sys/block/<disk>/queue/zone_write_granularity
594*849ab826SEric BiggersDate:		January 2021
595*849ab826SEric BiggersContact:	linux-block@vger.kernel.org
596*849ab826SEric BiggersDescription:
597*849ab826SEric Biggers		[RO] This indicates the alignment constraint, in bytes, for
598*849ab826SEric Biggers		write operations in sequential zones of zoned block devices
599*849ab826SEric Biggers		(devices with a zoned attributed that reports "host-managed" or
600*849ab826SEric Biggers		"host-aware"). This value is always 0 for regular block devices.
60107c9093cSEric Biggers
60207c9093cSEric Biggers
60307c9093cSEric BiggersWhat:		/sys/block/<disk>/queue/zoned
60407c9093cSEric BiggersDate:		September 2016
60507c9093cSEric BiggersContact:	Damien Le Moal <damien.lemoal@wdc.com>
60607c9093cSEric BiggersDescription:
607*849ab826SEric Biggers		[RO] zoned indicates if the device is a zoned block device and
608*849ab826SEric Biggers		the zone model of the device if it is indeed zoned.  The
609*849ab826SEric Biggers		possible values indicated by zoned are "none" for regular block
610*849ab826SEric Biggers		devices and "host-aware" or "host-managed" for zoned block
611*849ab826SEric Biggers		devices. The characteristics of host-aware and host-managed
612*849ab826SEric Biggers		zoned block devices are described in the ZBC (Zoned Block
613*849ab826SEric Biggers		Commands) and ZAC (Zoned Device ATA Command Set) standards.
614*849ab826SEric Biggers		These standards also define the "drive-managed" zone model.
615*849ab826SEric Biggers		However, since drive-managed zoned block devices do not support
616*849ab826SEric Biggers		zone commands, they will be treated as regular block devices and
617*849ab826SEric Biggers		zoned will report "none".
61807c9093cSEric Biggers
61907c9093cSEric Biggers
620ae7a7a53SEric BiggersWhat:		/sys/block/<disk>/stat
621ae7a7a53SEric BiggersDate:		February 2008
622ae7a7a53SEric BiggersContact:	Jerome Marchand <jmarchan@redhat.com>
623ae7a7a53SEric BiggersDescription:
624ae7a7a53SEric Biggers		The /sys/block/<disk>/stat files displays the I/O
625ae7a7a53SEric Biggers		statistics of disk <disk>. They contain 11 fields:
626ae7a7a53SEric Biggers
627ae7a7a53SEric Biggers		==  ==============================================
628ae7a7a53SEric Biggers		 1  reads completed successfully
629ae7a7a53SEric Biggers		 2  reads merged
630ae7a7a53SEric Biggers		 3  sectors read
631ae7a7a53SEric Biggers		 4  time spent reading (ms)
632ae7a7a53SEric Biggers		 5  writes completed
633ae7a7a53SEric Biggers		 6  writes merged
634ae7a7a53SEric Biggers		 7  sectors written
635ae7a7a53SEric Biggers		 8  time spent writing (ms)
636ae7a7a53SEric Biggers		 9  I/Os currently in progress
637ae7a7a53SEric Biggers		10  time spent doing I/Os (ms)
638ae7a7a53SEric Biggers		11  weighted time spent doing I/Os (ms)
639ae7a7a53SEric Biggers		12  discards completed
640ae7a7a53SEric Biggers		13  discards merged
641ae7a7a53SEric Biggers		14  sectors discarded
642ae7a7a53SEric Biggers		15  time spent discarding (ms)
643ae7a7a53SEric Biggers		16  flush requests completed
644ae7a7a53SEric Biggers		17  time spent flushing (ms)
645ae7a7a53SEric Biggers		==  ==============================================
646ae7a7a53SEric Biggers
647ae7a7a53SEric Biggers		For more details refer Documentation/admin-guide/iostats.rst
648