xref: /OK3568_Linux_fs/kernel/Documentation/ABI/testing/sysfs-block (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunWhat:		/sys/block/<disk>/stat
2*4882a593SmuzhiyunDate:		February 2008
3*4882a593SmuzhiyunContact:	Jerome Marchand <jmarchan@redhat.com>
4*4882a593SmuzhiyunDescription:
5*4882a593Smuzhiyun		The /sys/block/<disk>/stat files displays the I/O
6*4882a593Smuzhiyun		statistics of disk <disk>. They contain 11 fields:
7*4882a593Smuzhiyun
8*4882a593Smuzhiyun		==  ==============================================
9*4882a593Smuzhiyun		 1  reads completed successfully
10*4882a593Smuzhiyun		 2  reads merged
11*4882a593Smuzhiyun		 3  sectors read
12*4882a593Smuzhiyun		 4  time spent reading (ms)
13*4882a593Smuzhiyun		 5  writes completed
14*4882a593Smuzhiyun		 6  writes merged
15*4882a593Smuzhiyun		 7  sectors written
16*4882a593Smuzhiyun		 8  time spent writing (ms)
17*4882a593Smuzhiyun		 9  I/Os currently in progress
18*4882a593Smuzhiyun		10  time spent doing I/Os (ms)
19*4882a593Smuzhiyun		11  weighted time spent doing I/Os (ms)
20*4882a593Smuzhiyun		12  discards completed
21*4882a593Smuzhiyun		13  discards merged
22*4882a593Smuzhiyun		14  sectors discarded
23*4882a593Smuzhiyun		15  time spent discarding (ms)
24*4882a593Smuzhiyun		16  flush requests completed
25*4882a593Smuzhiyun		17  time spent flushing (ms)
26*4882a593Smuzhiyun		==  ==============================================
27*4882a593Smuzhiyun
28*4882a593Smuzhiyun		For more details refer Documentation/admin-guide/iostats.rst
29*4882a593Smuzhiyun
30*4882a593Smuzhiyun
31*4882a593SmuzhiyunWhat:		/sys/block/<disk>/<part>/stat
32*4882a593SmuzhiyunDate:		February 2008
33*4882a593SmuzhiyunContact:	Jerome Marchand <jmarchan@redhat.com>
34*4882a593SmuzhiyunDescription:
35*4882a593Smuzhiyun		The /sys/block/<disk>/<part>/stat files display the
36*4882a593Smuzhiyun		I/O statistics of partition <part>. The format is the
37*4882a593Smuzhiyun		same as the above-written /sys/block/<disk>/stat
38*4882a593Smuzhiyun		format.
39*4882a593Smuzhiyun
40*4882a593Smuzhiyun
41*4882a593SmuzhiyunWhat:		/sys/block/<disk>/integrity/format
42*4882a593SmuzhiyunDate:		June 2008
43*4882a593SmuzhiyunContact:	Martin K. Petersen <martin.petersen@oracle.com>
44*4882a593SmuzhiyunDescription:
45*4882a593Smuzhiyun		Metadata format for integrity capable block device.
46*4882a593Smuzhiyun		E.g. T10-DIF-TYPE1-CRC.
47*4882a593Smuzhiyun
48*4882a593Smuzhiyun
49*4882a593SmuzhiyunWhat:		/sys/block/<disk>/integrity/read_verify
50*4882a593SmuzhiyunDate:		June 2008
51*4882a593SmuzhiyunContact:	Martin K. Petersen <martin.petersen@oracle.com>
52*4882a593SmuzhiyunDescription:
53*4882a593Smuzhiyun		Indicates whether the block layer should verify the
54*4882a593Smuzhiyun		integrity of read requests serviced by devices that
55*4882a593Smuzhiyun		support sending integrity metadata.
56*4882a593Smuzhiyun
57*4882a593Smuzhiyun
58*4882a593SmuzhiyunWhat:		/sys/block/<disk>/integrity/tag_size
59*4882a593SmuzhiyunDate:		June 2008
60*4882a593SmuzhiyunContact:	Martin K. Petersen <martin.petersen@oracle.com>
61*4882a593SmuzhiyunDescription:
62*4882a593Smuzhiyun		Number of bytes of integrity tag space available per
63*4882a593Smuzhiyun		512 bytes of data.
64*4882a593Smuzhiyun
65*4882a593Smuzhiyun
66*4882a593SmuzhiyunWhat:		/sys/block/<disk>/integrity/device_is_integrity_capable
67*4882a593SmuzhiyunDate:		July 2014
68*4882a593SmuzhiyunContact:	Martin K. Petersen <martin.petersen@oracle.com>
69*4882a593SmuzhiyunDescription:
70*4882a593Smuzhiyun		Indicates whether a storage device is capable of storing
71*4882a593Smuzhiyun		integrity metadata. Set if the device is T10 PI-capable.
72*4882a593Smuzhiyun
73*4882a593SmuzhiyunWhat:		/sys/block/<disk>/integrity/protection_interval_bytes
74*4882a593SmuzhiyunDate:		July 2015
75*4882a593SmuzhiyunContact:	Martin K. Petersen <martin.petersen@oracle.com>
76*4882a593SmuzhiyunDescription:
77*4882a593Smuzhiyun		Describes the number of data bytes which are protected
78*4882a593Smuzhiyun		by one integrity tuple. Typically the device's logical
79*4882a593Smuzhiyun		block size.
80*4882a593Smuzhiyun
81*4882a593SmuzhiyunWhat:		/sys/block/<disk>/integrity/write_generate
82*4882a593SmuzhiyunDate:		June 2008
83*4882a593SmuzhiyunContact:	Martin K. Petersen <martin.petersen@oracle.com>
84*4882a593SmuzhiyunDescription:
85*4882a593Smuzhiyun		Indicates whether the block layer should automatically
86*4882a593Smuzhiyun		generate checksums for write requests bound for
87*4882a593Smuzhiyun		devices that support receiving integrity metadata.
88*4882a593Smuzhiyun
89*4882a593SmuzhiyunWhat:		/sys/block/<disk>/alignment_offset
90*4882a593SmuzhiyunDate:		April 2009
91*4882a593SmuzhiyunContact:	Martin K. Petersen <martin.petersen@oracle.com>
92*4882a593SmuzhiyunDescription:
93*4882a593Smuzhiyun		Storage devices may report a physical block size that is
94*4882a593Smuzhiyun		bigger than the logical block size (for instance a drive
95*4882a593Smuzhiyun		with 4KB physical sectors exposing 512-byte logical
96*4882a593Smuzhiyun		blocks to the operating system).  This parameter
97*4882a593Smuzhiyun		indicates how many bytes the beginning of the device is
98*4882a593Smuzhiyun		offset from the disk's natural alignment.
99*4882a593Smuzhiyun
100*4882a593SmuzhiyunWhat:		/sys/block/<disk>/<partition>/alignment_offset
101*4882a593SmuzhiyunDate:		April 2009
102*4882a593SmuzhiyunContact:	Martin K. Petersen <martin.petersen@oracle.com>
103*4882a593SmuzhiyunDescription:
104*4882a593Smuzhiyun		Storage devices may report a physical block size that is
105*4882a593Smuzhiyun		bigger than the logical block size (for instance a drive
106*4882a593Smuzhiyun		with 4KB physical sectors exposing 512-byte logical
107*4882a593Smuzhiyun		blocks to the operating system).  This parameter
108*4882a593Smuzhiyun		indicates how many bytes the beginning of the partition
109*4882a593Smuzhiyun		is offset from the disk's natural alignment.
110*4882a593Smuzhiyun
111*4882a593SmuzhiyunWhat:		/sys/block/<disk>/queue/logical_block_size
112*4882a593SmuzhiyunDate:		May 2009
113*4882a593SmuzhiyunContact:	Martin K. Petersen <martin.petersen@oracle.com>
114*4882a593SmuzhiyunDescription:
115*4882a593Smuzhiyun		This is the smallest unit the storage device can
116*4882a593Smuzhiyun		address.  It is typically 512 bytes.
117*4882a593Smuzhiyun
118*4882a593SmuzhiyunWhat:		/sys/block/<disk>/queue/physical_block_size
119*4882a593SmuzhiyunDate:		May 2009
120*4882a593SmuzhiyunContact:	Martin K. Petersen <martin.petersen@oracle.com>
121*4882a593SmuzhiyunDescription:
122*4882a593Smuzhiyun		This is the smallest unit a physical storage device can
123*4882a593Smuzhiyun		write atomically.  It is usually the same as the logical
124*4882a593Smuzhiyun		block size but may be bigger.  One example is SATA
125*4882a593Smuzhiyun		drives with 4KB sectors that expose a 512-byte logical
126*4882a593Smuzhiyun		block size to the operating system.  For stacked block
127*4882a593Smuzhiyun		devices the physical_block_size variable contains the
128*4882a593Smuzhiyun		maximum physical_block_size of the component devices.
129*4882a593Smuzhiyun
130*4882a593SmuzhiyunWhat:		/sys/block/<disk>/queue/minimum_io_size
131*4882a593SmuzhiyunDate:		April 2009
132*4882a593SmuzhiyunContact:	Martin K. Petersen <martin.petersen@oracle.com>
133*4882a593SmuzhiyunDescription:
134*4882a593Smuzhiyun		Storage devices may report a granularity or preferred
135*4882a593Smuzhiyun		minimum I/O size which is the smallest request the
136*4882a593Smuzhiyun		device can perform without incurring a performance
137*4882a593Smuzhiyun		penalty.  For disk drives this is often the physical
138*4882a593Smuzhiyun		block size.  For RAID arrays it is often the stripe
139*4882a593Smuzhiyun		chunk size.  A properly aligned multiple of
140*4882a593Smuzhiyun		minimum_io_size is the preferred request size for
141*4882a593Smuzhiyun		workloads where a high number of I/O operations is
142*4882a593Smuzhiyun		desired.
143*4882a593Smuzhiyun
144*4882a593SmuzhiyunWhat:		/sys/block/<disk>/queue/optimal_io_size
145*4882a593SmuzhiyunDate:		April 2009
146*4882a593SmuzhiyunContact:	Martin K. Petersen <martin.petersen@oracle.com>
147*4882a593SmuzhiyunDescription:
148*4882a593Smuzhiyun		Storage devices may report an optimal I/O size, which is
149*4882a593Smuzhiyun		the device's preferred unit for sustained I/O.  This is
150*4882a593Smuzhiyun		rarely reported for disk drives.  For RAID arrays it is
151*4882a593Smuzhiyun		usually the stripe width or the internal track size.  A
152*4882a593Smuzhiyun		properly aligned multiple of optimal_io_size is the
153*4882a593Smuzhiyun		preferred request size for workloads where sustained
154*4882a593Smuzhiyun		throughput is desired.  If no optimal I/O size is
155*4882a593Smuzhiyun		reported this file contains 0.
156*4882a593Smuzhiyun
157*4882a593SmuzhiyunWhat:		/sys/block/<disk>/queue/nomerges
158*4882a593SmuzhiyunDate:		January 2010
159*4882a593SmuzhiyunContact:
160*4882a593SmuzhiyunDescription:
161*4882a593Smuzhiyun		Standard I/O elevator operations include attempts to
162*4882a593Smuzhiyun		merge contiguous I/Os. For known random I/O loads these
163*4882a593Smuzhiyun		attempts will always fail and result in extra cycles
164*4882a593Smuzhiyun		being spent in the kernel. This allows one to turn off
165*4882a593Smuzhiyun		this behavior on one of two ways: When set to 1, complex
166*4882a593Smuzhiyun		merge checks are disabled, but the simple one-shot merges
167*4882a593Smuzhiyun		with the previous I/O request are enabled. When set to 2,
168*4882a593Smuzhiyun		all merge tries are disabled. The default value is 0 -
169*4882a593Smuzhiyun		which enables all types of merge tries.
170*4882a593Smuzhiyun
171*4882a593SmuzhiyunWhat:		/sys/block/<disk>/discard_alignment
172*4882a593SmuzhiyunDate:		May 2011
173*4882a593SmuzhiyunContact:	Martin K. Petersen <martin.petersen@oracle.com>
174*4882a593SmuzhiyunDescription:
175*4882a593Smuzhiyun		Devices that support discard functionality may
176*4882a593Smuzhiyun		internally allocate space in units that are bigger than
177*4882a593Smuzhiyun		the exported logical block size. The discard_alignment
178*4882a593Smuzhiyun		parameter indicates how many bytes the beginning of the
179*4882a593Smuzhiyun		device is offset from the internal allocation unit's
180*4882a593Smuzhiyun		natural alignment.
181*4882a593Smuzhiyun
182*4882a593SmuzhiyunWhat:		/sys/block/<disk>/<partition>/discard_alignment
183*4882a593SmuzhiyunDate:		May 2011
184*4882a593SmuzhiyunContact:	Martin K. Petersen <martin.petersen@oracle.com>
185*4882a593SmuzhiyunDescription:
186*4882a593Smuzhiyun		Devices that support discard functionality may
187*4882a593Smuzhiyun		internally allocate space in units that are bigger than
188*4882a593Smuzhiyun		the exported logical block size. The discard_alignment
189*4882a593Smuzhiyun		parameter indicates how many bytes the beginning of the
190*4882a593Smuzhiyun		partition is offset from the internal allocation unit's
191*4882a593Smuzhiyun		natural alignment.
192*4882a593Smuzhiyun
193*4882a593SmuzhiyunWhat:		/sys/block/<disk>/queue/discard_granularity
194*4882a593SmuzhiyunDate:		May 2011
195*4882a593SmuzhiyunContact:	Martin K. Petersen <martin.petersen@oracle.com>
196*4882a593SmuzhiyunDescription:
197*4882a593Smuzhiyun		Devices that support discard functionality may
198*4882a593Smuzhiyun		internally allocate space using units that are bigger
199*4882a593Smuzhiyun		than the logical block size. The discard_granularity
200*4882a593Smuzhiyun		parameter indicates the size of the internal allocation
201*4882a593Smuzhiyun		unit in bytes if reported by the device. Otherwise the
202*4882a593Smuzhiyun		discard_granularity will be set to match the device's
203*4882a593Smuzhiyun		physical block size. A discard_granularity of 0 means
204*4882a593Smuzhiyun		that the device does not support discard functionality.
205*4882a593Smuzhiyun
206*4882a593SmuzhiyunWhat:		/sys/block/<disk>/queue/discard_max_bytes
207*4882a593SmuzhiyunDate:		May 2011
208*4882a593SmuzhiyunContact:	Martin K. Petersen <martin.petersen@oracle.com>
209*4882a593SmuzhiyunDescription:
210*4882a593Smuzhiyun		Devices that support discard functionality may have
211*4882a593Smuzhiyun		internal limits on the number of bytes that can be
212*4882a593Smuzhiyun		trimmed or unmapped in a single operation. Some storage
213*4882a593Smuzhiyun		protocols also have inherent limits on the number of
214*4882a593Smuzhiyun		blocks that can be described in a single command. The
215*4882a593Smuzhiyun		discard_max_bytes parameter is set by the device driver
216*4882a593Smuzhiyun		to the maximum number of bytes that can be discarded in
217*4882a593Smuzhiyun		a single operation. Discard requests issued to the
218*4882a593Smuzhiyun		device must not exceed this limit. A discard_max_bytes
219*4882a593Smuzhiyun		value of 0 means that the device does not support
220*4882a593Smuzhiyun		discard functionality.
221*4882a593Smuzhiyun
222*4882a593SmuzhiyunWhat:		/sys/block/<disk>/queue/discard_zeroes_data
223*4882a593SmuzhiyunDate:		May 2011
224*4882a593SmuzhiyunContact:	Martin K. Petersen <martin.petersen@oracle.com>
225*4882a593SmuzhiyunDescription:
226*4882a593Smuzhiyun		Will always return 0.  Don't rely on any specific behavior
227*4882a593Smuzhiyun		for discards, and don't read this file.
228*4882a593Smuzhiyun
229*4882a593SmuzhiyunWhat:		/sys/block/<disk>/queue/write_same_max_bytes
230*4882a593SmuzhiyunDate:		January 2012
231*4882a593SmuzhiyunContact:	Martin K. Petersen <martin.petersen@oracle.com>
232*4882a593SmuzhiyunDescription:
233*4882a593Smuzhiyun		Some devices support a write same operation in which a
234*4882a593Smuzhiyun		single data block can be written to a range of several
235*4882a593Smuzhiyun		contiguous blocks on storage. This can be used to wipe
236*4882a593Smuzhiyun		areas on disk or to initialize drives in a RAID
237*4882a593Smuzhiyun		configuration. write_same_max_bytes indicates how many
238*4882a593Smuzhiyun		bytes can be written in a single write same command. If
239*4882a593Smuzhiyun		write_same_max_bytes is 0, write same is not supported
240*4882a593Smuzhiyun		by the device.
241*4882a593Smuzhiyun
242*4882a593SmuzhiyunWhat:		/sys/block/<disk>/queue/write_zeroes_max_bytes
243*4882a593SmuzhiyunDate:		November 2016
244*4882a593SmuzhiyunContact:	Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
245*4882a593SmuzhiyunDescription:
246*4882a593Smuzhiyun		Devices that support write zeroes operation in which a
247*4882a593Smuzhiyun		single request can be issued to zero out the range of
248*4882a593Smuzhiyun		contiguous blocks on storage without having any payload
249*4882a593Smuzhiyun		in the request. This can be used to optimize writing zeroes
250*4882a593Smuzhiyun		to the devices. write_zeroes_max_bytes indicates how many
251*4882a593Smuzhiyun		bytes can be written in a single write zeroes command. If
252*4882a593Smuzhiyun		write_zeroes_max_bytes is 0, write zeroes is not supported
253*4882a593Smuzhiyun		by the device.
254*4882a593Smuzhiyun
255*4882a593SmuzhiyunWhat:		/sys/block/<disk>/queue/zoned
256*4882a593SmuzhiyunDate:		September 2016
257*4882a593SmuzhiyunContact:	Damien Le Moal <damien.lemoal@wdc.com>
258*4882a593SmuzhiyunDescription:
259*4882a593Smuzhiyun		zoned indicates if the device is a zoned block device
260*4882a593Smuzhiyun		and the zone model of the device if it is indeed zoned.
261*4882a593Smuzhiyun		The possible values indicated by zoned are "none" for
262*4882a593Smuzhiyun		regular block devices and "host-aware" or "host-managed"
263*4882a593Smuzhiyun		for zoned block devices. The characteristics of
264*4882a593Smuzhiyun		host-aware and host-managed zoned block devices are
265*4882a593Smuzhiyun		described in the ZBC (Zoned Block Commands) and ZAC
266*4882a593Smuzhiyun		(Zoned Device ATA Command Set) standards. These standards
267*4882a593Smuzhiyun		also define the "drive-managed" zone model. However,
268*4882a593Smuzhiyun		since drive-managed zoned block devices do not support
269*4882a593Smuzhiyun		zone commands, they will be treated as regular block
270*4882a593Smuzhiyun		devices and zoned will report "none".
271*4882a593Smuzhiyun
272*4882a593SmuzhiyunWhat:		/sys/block/<disk>/queue/nr_zones
273*4882a593SmuzhiyunDate:		November 2018
274*4882a593SmuzhiyunContact:	Damien Le Moal <damien.lemoal@wdc.com>
275*4882a593SmuzhiyunDescription:
276*4882a593Smuzhiyun		nr_zones indicates the total number of zones of a zoned block
277*4882a593Smuzhiyun		device ("host-aware" or "host-managed" zone model). For regular
278*4882a593Smuzhiyun		block devices, the value is always 0.
279*4882a593Smuzhiyun
280*4882a593SmuzhiyunWhat:		/sys/block/<disk>/queue/max_active_zones
281*4882a593SmuzhiyunDate:		July 2020
282*4882a593SmuzhiyunContact:	Niklas Cassel <niklas.cassel@wdc.com>
283*4882a593SmuzhiyunDescription:
284*4882a593Smuzhiyun		For zoned block devices (zoned attribute indicating
285*4882a593Smuzhiyun		"host-managed" or "host-aware"), the sum of zones belonging to
286*4882a593Smuzhiyun		any of the zone states: EXPLICIT OPEN, IMPLICIT OPEN or CLOSED,
287*4882a593Smuzhiyun		is limited by this value. If this value is 0, there is no limit.
288*4882a593Smuzhiyun
289*4882a593SmuzhiyunWhat:		/sys/block/<disk>/queue/max_open_zones
290*4882a593SmuzhiyunDate:		July 2020
291*4882a593SmuzhiyunContact:	Niklas Cassel <niklas.cassel@wdc.com>
292*4882a593SmuzhiyunDescription:
293*4882a593Smuzhiyun		For zoned block devices (zoned attribute indicating
294*4882a593Smuzhiyun		"host-managed" or "host-aware"), the sum of zones belonging to
295*4882a593Smuzhiyun		any of the zone states: EXPLICIT OPEN or IMPLICIT OPEN,
296*4882a593Smuzhiyun		is limited by this value. If this value is 0, there is no limit.
297*4882a593Smuzhiyun
298*4882a593SmuzhiyunWhat:		/sys/block/<disk>/queue/chunk_sectors
299*4882a593SmuzhiyunDate:		September 2016
300*4882a593SmuzhiyunContact:	Hannes Reinecke <hare@suse.com>
301*4882a593SmuzhiyunDescription:
302*4882a593Smuzhiyun		chunk_sectors has different meaning depending on the type
303*4882a593Smuzhiyun		of the disk. For a RAID device (dm-raid), chunk_sectors
304*4882a593Smuzhiyun		indicates the size in 512B sectors of the RAID volume
305*4882a593Smuzhiyun		stripe segment. For a zoned block device, either
306*4882a593Smuzhiyun		host-aware or host-managed, chunk_sectors indicates the
307*4882a593Smuzhiyun		size in 512B sectors of the zones of the device, with
308*4882a593Smuzhiyun		the eventual exception of the last zone of the device
309*4882a593Smuzhiyun		which may be smaller.
310*4882a593Smuzhiyun
311*4882a593SmuzhiyunWhat:		/sys/block/<disk>/queue/io_timeout
312*4882a593SmuzhiyunDate:		November 2018
313*4882a593SmuzhiyunContact:	Weiping Zhang <zhangweiping@didiglobal.com>
314*4882a593SmuzhiyunDescription:
315*4882a593Smuzhiyun		io_timeout is the request timeout in milliseconds. If a request
316*4882a593Smuzhiyun		does not complete in this time then the block driver timeout
317*4882a593Smuzhiyun		handler is invoked. That timeout handler can decide to retry
318*4882a593Smuzhiyun		the request, to fail it or to start a device recovery strategy.
319