Skip to content

Commit

Permalink
[PATCH] io-accounting: read accounting
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Dec 10, 2006
1 parent e08748c commit faccbd4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions block/ll_rw_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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];
Expand Down

0 comments on commit faccbd4

Please sign in to comment.