From: Andrew Morton Date: Sun, 10 Dec 2006 10:19:35 +0000 (-0800) Subject: [PATCH] io-accounting: read accounting X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=faccbd4b26df7bd977cee33d4145155d0ef95c87;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git [PATCH] io-accounting: read accounting Wire up read accounting for block devices, within submit_bio(). Cc: Jay Lan Cc: Shailabh Nagar Cc: Balbir Singh Cc: Chris Sturtivant Cc: Tony Ernst Cc: Guillaume Thouvenin Cc: David Wright Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index 4f83fd922377..785e61c9a810 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -3235,10 +3236,12 @@ void submit_bio(int rw, struct bio *bio) BIO_BUG_ON(!bio->bi_size); BIO_BUG_ON(!bio->bi_io_vec); bio->bi_rw |= rw; - if (rw & WRITE) + if (rw & WRITE) { count_vm_events(PGPGOUT, count); - else + } else { + task_io_account_read(bio->bi_size); count_vm_events(PGPGIN, count); + } if (unlikely(block_dump)) { char b[BDEVNAME_SIZE];