aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2006-05-23 05:23:49 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-05-23 13:39:43 -0400
commitfd0ff8aa1d95a896b3627bc62d42d6d002ac0bc3 (patch)
treee4ba36d57ca288eeaebdc882b988833e86607b22
parent0f0410823792ae0ecb45f2578598b115835ffdbb (diff)
[PATCH] blk: fix gendisk->in_flight accounting during barrier sequence
While executing barrrier sequence, the bar_rq which carries actual write was accounted as normal IO on completion, while it wasn't on queueing. This caused gendisk->in_flight to be decremented by 1 after each barrier thus messed up statistics. This patch makes bar_rq not accounted as normal IO. As the containing barrier request as a whole is accounted, part of it shouldn't be. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jens Axboe <axboe@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--block/ll_rw_blk.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index eac48bec147..7eb36c53f4b 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -3452,7 +3452,12 @@ void end_that_request_last(struct request *req, int uptodate)
3452 if (unlikely(laptop_mode) && blk_fs_request(req)) 3452 if (unlikely(laptop_mode) && blk_fs_request(req))
3453 laptop_io_completion(); 3453 laptop_io_completion();
3454 3454
3455 if (disk && blk_fs_request(req)) { 3455 /*
3456 * Account IO completion. bar_rq isn't accounted as a normal
3457 * IO on queueing nor completion. Accounting the containing
3458 * request is enough.
3459 */
3460 if (disk && blk_fs_request(req) && req != &req->q->bar_rq) {
3456 unsigned long duration = jiffies - req->start_time; 3461 unsigned long duration = jiffies - req->start_time;
3457 const int rw = rq_data_dir(req); 3462 const int rw = rq_data_dir(req);
3458 3463