^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) ===================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) Block IO Controller
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) ===================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) Overview
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) ========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) cgroup subsys "blkio" implements the block io controller. There seems to be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) a need of various kinds of IO control policies (like proportional BW, max BW)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) both at leaf nodes as well as at intermediate nodes in a storage hierarchy.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) Plan is to use the same cgroup based management interface for blkio controller
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) and based on user options switch IO policies in the background.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) One IO control policy is throttling policy which can be used to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) specify upper IO rate limits on devices. This policy is implemented in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) generic block layer and can be used on leaf nodes as well as higher
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) level logical devices like device mapper.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) HOWTO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) =====
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) Throttling/Upper Limit policy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) -----------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) - Enable Block IO controller::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) CONFIG_BLK_CGROUP=y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) - Enable throttling in block layer::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) CONFIG_BLK_DEV_THROTTLING=y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) - Mount blkio controller (see cgroups.txt, Why are cgroups needed?)::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) mount -t cgroup -o blkio none /sys/fs/cgroup/blkio
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) - Specify a bandwidth rate on particular device for root group. The format
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) for policy is "<major>:<minor> <bytes_per_second>"::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) echo "8:16 1048576" > /sys/fs/cgroup/blkio/blkio.throttle.read_bps_device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) Above will put a limit of 1MB/second on reads happening for root group
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) on device having major/minor number 8:16.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) - Run dd to read a file and see if rate is throttled to 1MB/s or not::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) # dd iflag=direct if=/mnt/common/zerofile of=/dev/null bs=4K count=1024
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) 1024+0 records in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) 1024+0 records out
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) 4194304 bytes (4.2 MB) copied, 4.0001 s, 1.0 MB/s
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) Limits for writes can be put using blkio.throttle.write_bps_device file.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) Hierarchical Cgroups
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) ====================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) Throttling implements hierarchy support; however,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) throttling's hierarchy support is enabled iff "sane_behavior" is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) enabled from cgroup side, which currently is a development option and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) not publicly available.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) If somebody created a hierarchy like as follows::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) root
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) / \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) test1 test2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) test3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) Throttling with "sane_behavior" will handle the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) hierarchy correctly. For throttling, all limits apply
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) to the whole subtree while all statistics are local to the IOs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) directly generated by tasks in that cgroup.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) Throttling without "sane_behavior" enabled from cgroup side will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) practically treat all groups at same level as if it looks like the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) following::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) pivot
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) / / \ \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) root test1 test2 test3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) Various user visible config options
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) ===================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) CONFIG_BLK_CGROUP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) - Block IO controller.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) CONFIG_BFQ_CGROUP_DEBUG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) - Debug help. Right now some additional stats file show up in cgroup
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) if this option is enabled.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) CONFIG_BLK_DEV_THROTTLING
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) - Enable block device throttling support in block layer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) Details of cgroup files
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) =======================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) Proportional weight policy files
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) --------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) - blkio.weight
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) - Specifies per cgroup weight. This is default weight of the group
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) on all the devices until and unless overridden by per device rule.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) (See blkio.weight_device).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) Currently allowed range of weights is from 10 to 1000.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) - blkio.weight_device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) - One can specify per cgroup per device rules using this interface.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) These rules override the default value of group weight as specified
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) by blkio.weight.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) Following is the format::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) # echo dev_maj:dev_minor weight > blkio.weight_device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) Configure weight=300 on /dev/sdb (8:16) in this cgroup::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) # echo 8:16 300 > blkio.weight_device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) # cat blkio.weight_device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) dev weight
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 8:16 300
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) Configure weight=500 on /dev/sda (8:0) in this cgroup::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) # echo 8:0 500 > blkio.weight_device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) # cat blkio.weight_device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) dev weight
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 8:0 500
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 8:16 300
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) Remove specific weight for /dev/sda in this cgroup::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) # echo 8:0 0 > blkio.weight_device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) # cat blkio.weight_device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) dev weight
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 8:16 300
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) - blkio.time
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) - disk time allocated to cgroup per device in milliseconds. First
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) two fields specify the major and minor number of the device and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) third field specifies the disk time allocated to group in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) milliseconds.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) - blkio.sectors
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) - number of sectors transferred to/from disk by the group. First
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) two fields specify the major and minor number of the device and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) third field specifies the number of sectors transferred by the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) group to/from the device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) - blkio.io_service_bytes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) - Number of bytes transferred to/from the disk by the group. These
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) are further divided by the type of operation - read or write, sync
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) or async. First two fields specify the major and minor number of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) device, third field specifies the operation type and the fourth field
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) specifies the number of bytes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) - blkio.io_serviced
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) - Number of IOs (bio) issued to the disk by the group. These
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) are further divided by the type of operation - read or write, sync
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) or async. First two fields specify the major and minor number of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) device, third field specifies the operation type and the fourth field
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) specifies the number of IOs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) - blkio.io_service_time
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) - Total amount of time between request dispatch and request completion
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) for the IOs done by this cgroup. This is in nanoseconds to make it
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) meaningful for flash devices too. For devices with queue depth of 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) this time represents the actual service time. When queue_depth > 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) that is no longer true as requests may be served out of order. This
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) may cause the service time for a given IO to include the service time
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) of multiple IOs when served out of order which may result in total
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) io_service_time > actual time elapsed. This time is further divided by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) the type of operation - read or write, sync or async. First two fields
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) specify the major and minor number of the device, third field
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) specifies the operation type and the fourth field specifies the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) io_service_time in ns.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) - blkio.io_wait_time
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) - Total amount of time the IOs for this cgroup spent waiting in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) scheduler queues for service. This can be greater than the total time
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) elapsed since it is cumulative io_wait_time for all IOs. It is not a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) measure of total time the cgroup spent waiting but rather a measure of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) the wait_time for its individual IOs. For devices with queue_depth > 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) this metric does not include the time spent waiting for service once
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) the IO is dispatched to the device but till it actually gets serviced
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) (there might be a time lag here due to re-ordering of requests by the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) device). This is in nanoseconds to make it meaningful for flash
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) devices too. This time is further divided by the type of operation -
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) read or write, sync or async. First two fields specify the major and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) minor number of the device, third field specifies the operation type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) and the fourth field specifies the io_wait_time in ns.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) - blkio.io_merged
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) - Total number of bios/requests merged into requests belonging to this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) cgroup. This is further divided by the type of operation - read or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) write, sync or async.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) - blkio.io_queued
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) - Total number of requests queued up at any given instant for this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) cgroup. This is further divided by the type of operation - read or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) write, sync or async.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) - blkio.avg_queue_size
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) - Debugging aid only enabled if CONFIG_BFQ_CGROUP_DEBUG=y.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) The average queue size for this cgroup over the entire time of this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) cgroup's existence. Queue size samples are taken each time one of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) queues of this cgroup gets a timeslice.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) - blkio.group_wait_time
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) - Debugging aid only enabled if CONFIG_BFQ_CGROUP_DEBUG=y.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) This is the amount of time the cgroup had to wait since it became busy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) (i.e., went from 0 to 1 request queued) to get a timeslice for one of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) its queues. This is different from the io_wait_time which is the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) cumulative total of the amount of time spent by each IO in that cgroup
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) waiting in the scheduler queue. This is in nanoseconds. If this is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) read when the cgroup is in a waiting (for timeslice) state, the stat
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) will only report the group_wait_time accumulated till the last time it
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) got a timeslice and will not include the current delta.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) - blkio.empty_time
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) - Debugging aid only enabled if CONFIG_BFQ_CGROUP_DEBUG=y.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) This is the amount of time a cgroup spends without any pending
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) requests when not being served, i.e., it does not include any time
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) spent idling for one of the queues of the cgroup. This is in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) nanoseconds. If this is read when the cgroup is in an empty state,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) the stat will only report the empty_time accumulated till the last
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) time it had a pending request and will not include the current delta.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) - blkio.idle_time
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) - Debugging aid only enabled if CONFIG_BFQ_CGROUP_DEBUG=y.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) This is the amount of time spent by the IO scheduler idling for a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) given cgroup in anticipation of a better request than the existing ones
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) from other queues/cgroups. This is in nanoseconds. If this is read
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) when the cgroup is in an idling state, the stat will only report the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) idle_time accumulated till the last idle period and will not include
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) the current delta.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) - blkio.dequeue
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) - Debugging aid only enabled if CONFIG_BFQ_CGROUP_DEBUG=y. This
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) gives the statistics about how many a times a group was dequeued
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) from service tree of the device. First two fields specify the major
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) and minor number of the device and third field specifies the number
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) of times a group was dequeued from a particular device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) - blkio.*_recursive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) - Recursive version of various stats. These files show the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) same information as their non-recursive counterparts but
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) include stats from all the descendant cgroups.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) Throttling/Upper limit policy files
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) -----------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) - blkio.throttle.read_bps_device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) - Specifies upper limit on READ rate from the device. IO rate is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) specified in bytes per second. Rules are per device. Following is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) the format::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) echo "<major>:<minor> <rate_bytes_per_second>" > /cgrp/blkio.throttle.read_bps_device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) - blkio.throttle.write_bps_device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) - Specifies upper limit on WRITE rate to the device. IO rate is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) specified in bytes per second. Rules are per device. Following is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) the format::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) echo "<major>:<minor> <rate_bytes_per_second>" > /cgrp/blkio.throttle.write_bps_device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) - blkio.throttle.read_iops_device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) - Specifies upper limit on READ rate from the device. IO rate is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) specified in IO per second. Rules are per device. Following is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) the format::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) echo "<major>:<minor> <rate_io_per_second>" > /cgrp/blkio.throttle.read_iops_device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) - blkio.throttle.write_iops_device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) - Specifies upper limit on WRITE rate to the device. IO rate is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) specified in io per second. Rules are per device. Following is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) the format::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) echo "<major>:<minor> <rate_io_per_second>" > /cgrp/blkio.throttle.write_iops_device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) Note: If both BW and IOPS rules are specified for a device, then IO is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) subjected to both the constraints.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) - blkio.throttle.io_serviced
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) - Number of IOs (bio) issued to the disk by the group. These
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) are further divided by the type of operation - read or write, sync
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) or async. First two fields specify the major and minor number of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) device, third field specifies the operation type and the fourth field
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) specifies the number of IOs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) - blkio.throttle.io_service_bytes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) - Number of bytes transferred to/from the disk by the group. These
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) are further divided by the type of operation - read or write, sync
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) or async. First two fields specify the major and minor number of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) device, third field specifies the operation type and the fourth field
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) specifies the number of bytes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) Common files among various policies
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) -----------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) - blkio.reset_stats
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) - Writing an int to this file will result in resetting all the stats
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) for that cgroup.