From: Andrew Morton 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 --- block/ll_rw_blk.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff -puN block/ll_rw_blk.c~io-accounting-read-accounting-2 block/ll_rw_blk.c --- a/block/ll_rw_blk.c~io-accounting-read-accounting-2 +++ a/block/ll_rw_blk.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -3109,10 +3110,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]; _