io-accounting: read accounting
PATCH 5/13 io-accounting: read accounting
From: Andrew Morton <[email protected]>
Wire up read accounting for block devices, within submit_bio().
Cc Jay Lan <[email protected]>
Cc Shailabh Nagar <[email protected]>
Cc Balbir Singh <[email protected]>
Cc Chris Sturtivant <[email protected]>
Cc Tony Ernst <[email protected]>
Cc Guillaume Thouvenin <[email protected]>
Cc David Wright <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
block/ll_rw_blk.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
block/ll_rw_blk.c renamed from block/ll_rw_blk.c~io-accounting-read-accounting-2 +5 -2
@@ -25,6 +25,7 @@#include <linux/slab.h> #include <linux/swap.h> #include <linux/writeback.h> +#include <linux/task_io_accounting_ops.h> #include <linux/interrupt.h> #include <linux/cpu.h> #include <linux/blktrace_api.h>
@@ -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 ];
_