Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 27922b4260f65d317aabda37e42bbbff > files > 1984

kernel-2.6.18-238.el5.src.rpm

From: Jerome Marchand <jmarchan@redhat.com>
Date: Tue, 3 Mar 2009 17:27:28 +0100
Subject: [misc] IO accounting: read accounting
Message-id: 20090303162958.039482157@dhcp-0-152.brq.redhat.com
O-Subject: [RHEL5.4 Patch 06/12] IO accounting: read accounting
Bugzilla: 461636
RH-Acked-by: Jiri Pirko <jpirko@redhat.com>
RH-Acked-by: Jeff Moyer <jmoyer@redhat.com>

bz461636

Wire up read accounting for block devices, within submit_bio().

Patch is upstream:
commit faccbd4b26df7bd977cee33d4145155d0ef95c87

diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index b336b06..f9a794f 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>
@@ -3266,10 +3267,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];