提交 faccbd4b 编写于 作者: A Andrew Morton 提交者: Linus Torvalds

[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: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 e08748ce
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/swap.h> #include <linux/swap.h>
#include <linux/writeback.h> #include <linux/writeback.h>
#include <linux/task_io_accounting_ops.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/cpu.h> #include <linux/cpu.h>
#include <linux/blktrace_api.h> #include <linux/blktrace_api.h>
...@@ -3235,10 +3236,12 @@ void submit_bio(int rw, struct bio *bio) ...@@ -3235,10 +3236,12 @@ void submit_bio(int rw, struct bio *bio)
BIO_BUG_ON(!bio->bi_size); BIO_BUG_ON(!bio->bi_size);
BIO_BUG_ON(!bio->bi_io_vec); BIO_BUG_ON(!bio->bi_io_vec);
bio->bi_rw |= rw; bio->bi_rw |= rw;
if (rw & WRITE) if (rw & WRITE) {
count_vm_events(PGPGOUT, count); count_vm_events(PGPGOUT, count);
else } else {
task_io_account_read(bio->bi_size);
count_vm_events(PGPGIN, count); count_vm_events(PGPGIN, count);
}
if (unlikely(block_dump)) { if (unlikely(block_dump)) {
char b[BDEVNAME_SIZE]; char b[BDEVNAME_SIZE];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册