[<prev] [next>] [day] [month] [year] [list]
Message-Id: <200612081152.kB8BqRcH019762@shell0.pdx.osdl.net>
Date: Fri, 08 Dec 2006 03:52:27 -0800
From: akpm@...l.org
To: linux-kernel@...r.kernel.org
Cc: akpm@...l.org, balbir@...ibm.com, csturtiv@....com, daw@....com,
guillaume.thouvenin@...l.net, jlan@....com, nagar@...son.ibm.com,
tee@....com
Subject: [patch 05/13] io-accounting: read accounting
From: Andrew Morton <akpm@...l.org>
Wire up read accounting for block devices, within submit_bio().
Cc: Jay Lan <jlan@....com>
Cc: Shailabh Nagar <nagar@...son.ibm.com>
Cc: Balbir Singh <balbir@...ibm.com>
Cc: Chris Sturtivant <csturtiv@....com>
Cc: Tony Ernst <tee@....com>
Cc: Guillaume Thouvenin <guillaume.thouvenin@...l.net>
Cc: David Wright <daw@....com>
Signed-off-by: Andrew Morton <akpm@...l.org>
---
block/ll_rw_blk.c | 7 +++++--
1 file 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 <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];
_
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists