summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorAndrew Morton2006-12-10 11:19:35 +0100
committerLinus Torvalds2006-12-10 18:55:41 +0100
commitfaccbd4b26df7bd977cee33d4145155d0ef95c87 (patch)
treeea7a472bd00ada4c5391cfd18e5518ac7c180327 /block
parent[PATCH] io-accounting: write-cancel accounting (diff)
downloadkernel-qcow2-linux-faccbd4b26df7bd977cee33d4145155d0ef95c87.tar.gz
kernel-qcow2-linux-faccbd4b26df7bd977cee33d4145155d0ef95c87.tar.xz
kernel-qcow2-linux-faccbd4b26df7bd977cee33d4145155d0ef95c87.zip
[PATCH] io-accounting: read accounting
Wire up read accounting for block devices, within submit_bio(). Cc: Jay Lan <jlan@sgi.com> Cc: Shailabh Nagar <nagar@watson.ibm.com> Cc: Balbir Singh <balbir@in.ibm.com> Cc: Chris Sturtivant <csturtiv@sgi.com> Cc: Tony Ernst <tee@sgi.com> Cc: Guillaume Thouvenin <guillaume.thouvenin@bull.net> Cc: David Wright <daw@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'block')
-rw-r--r--block/ll_rw_blk.c7
1 files changed, 5 insertions, 2 deletions
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 <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];