Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[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>

authored by

Jens Axboe and committed by
Linus Torvalds
fd0ff8aa 0f041082

+6 -1
+6 -1
block/ll_rw_blk.c
··· 3452 3452 if (unlikely(laptop_mode) && blk_fs_request(req)) 3453 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 3461 unsigned long duration = jiffies - req->start_time; 3457 3462 const int rw = rq_data_dir(req); 3458 3463