0001 ===============================================
0002 Block layer statistics in /sys/block/<dev>/stat
0003 ===============================================
0004
0005 This file documents the contents of the /sys/block/<dev>/stat file.
0006
0007 The stat file provides several statistics about the state of block
0008 device <dev>.
0009
0010 Q.
0011 Why are there multiple statistics in a single file? Doesn't sysfs
0012 normally contain a single value per file?
0013
0014 A.
0015 By having a single file, the kernel can guarantee that the statistics
0016 represent a consistent snapshot of the state of the device. If the
0017 statistics were exported as multiple files containing one statistic
0018 each, it would be impossible to guarantee that a set of readings
0019 represent a single point in time.
0020
0021 The stat file consists of a single line of text containing 17 decimal
0022 values separated by whitespace. The fields are summarized in the
0023 following table, and described in more detail below.
0024
0025
0026 =============== ============= =================================================
0027 Name units description
0028 =============== ============= =================================================
0029 read I/Os requests number of read I/Os processed
0030 read merges requests number of read I/Os merged with in-queue I/O
0031 read sectors sectors number of sectors read
0032 read ticks milliseconds total wait time for read requests
0033 write I/Os requests number of write I/Os processed
0034 write merges requests number of write I/Os merged with in-queue I/O
0035 write sectors sectors number of sectors written
0036 write ticks milliseconds total wait time for write requests
0037 in_flight requests number of I/Os currently in flight
0038 io_ticks milliseconds total time this block device has been active
0039 time_in_queue milliseconds total wait time for all requests
0040 discard I/Os requests number of discard I/Os processed
0041 discard merges requests number of discard I/Os merged with in-queue I/O
0042 discard sectors sectors number of sectors discarded
0043 discard ticks milliseconds total wait time for discard requests
0044 flush I/Os requests number of flush I/Os processed
0045 flush ticks milliseconds total wait time for flush requests
0046 =============== ============= =================================================
0047
0048 read I/Os, write I/Os, discard I/0s
0049 ===================================
0050
0051 These values increment when an I/O request completes.
0052
0053 flush I/Os
0054 ==========
0055
0056 These values increment when an flush I/O request completes.
0057
0058 Block layer combines flush requests and executes at most one at a time.
0059 This counts flush requests executed by disk. Not tracked for partitions.
0060
0061 read merges, write merges, discard merges
0062 =========================================
0063
0064 These values increment when an I/O request is merged with an
0065 already-queued I/O request.
0066
0067 read sectors, write sectors, discard_sectors
0068 ============================================
0069
0070 These values count the number of sectors read from, written to, or
0071 discarded from this block device. The "sectors" in question are the
0072 standard UNIX 512-byte sectors, not any device- or filesystem-specific
0073 block size. The counters are incremented when the I/O completes.
0074
0075 read ticks, write ticks, discard ticks, flush ticks
0076 ===================================================
0077
0078 These values count the number of milliseconds that I/O requests have
0079 waited on this block device. If there are multiple I/O requests waiting,
0080 these values will increase at a rate greater than 1000/second; for
0081 example, if 60 read requests wait for an average of 30 ms, the read_ticks
0082 field will increase by 60*30 = 1800.
0083
0084 in_flight
0085 =========
0086
0087 This value counts the number of I/O requests that have been issued to
0088 the device driver but have not yet completed. It does not include I/O
0089 requests that are in the queue but not yet issued to the device driver.
0090
0091 io_ticks
0092 ========
0093
0094 This value counts the number of milliseconds during which the device has
0095 had I/O requests queued.
0096
0097 time_in_queue
0098 =============
0099
0100 This value counts the number of milliseconds that I/O requests have waited
0101 on this block device. If there are multiple I/O requests waiting, this
0102 value will increase as the product of the number of milliseconds times the
0103 number of requests waiting (see "read ticks" above for an example).