Atoptool / atop

System and process monitor for Linux
GNU General Public License v2.0
799 stars 111 forks source link

Fix disk busy in man page #196

Closed pizhenwei closed 2 years ago

pizhenwei commented 2 years ago

Reference source code from Linux: https://github.com/torvalds/linux/blob/master/block/blk-core.c

void update_io_ticks(struct block_device *part, unsigned long now, bool end) { unsigned long stamp; again: stamp = READ_ONCE(part->bd_stamp); if (unlikely(time_after(now, stamp))) { if (likely(cmpxchg(&part->bd_stamp, stamp, now) == stamp)) __part_stat_add(part, io_ticks, end ? now - stamp : 1); } if (part->bd_partno) { part = bdev_whole(part); goto again; } }

The io_ticks field records the elapsed time during which I/O requests were issued to the device. From this design, one or more I/O requests may occurs in the same tick, so this number does not reflect the performance limits of mordern SSD/NVMe.

atop reads this counter and calculates the percentage, fix the man page to introduce this.

Signed-off-by: zhenwei pi pizhenwei@bytedance.com