aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-flush.c
diff options
context:
space:
mode:
authorVladimir Davydov <vdavydov@parallels.com>2013-02-14 09:19:59 -0500
committerJens Axboe <axboe@kernel.dk>2013-02-15 10:45:07 -0500
commit5577022f4ed8973762450ebe7fe7ebfd953817db (patch)
treec6c965101e32bf2b36155da0fc0ad94c696d4606 /block/blk-flush.c
parent686855f5d833178e518d79e7912cdb3268a9fa69 (diff)
block: account iowait time when waiting for completion of IO request
Using wait_for_completion() for waiting for a IO request to be executed results in wrong iowait time accounting. For example, a system having the only task doing write() and fdatasync() on a block device can be reported being idle instead of iowaiting as it should because blkdev_issue_flush() calls wait_for_completion() which in turn calls schedule() that does not increment the iowait proc counter and thus does not turn on iowait time accounting. The patch makes block layer use wait_for_completion_io() instead of wait_for_completion() where appropriate to account iowait time correctly. Signed-off-by: Vladimir Davydov <vdavydov@parallels.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-flush.c')
-rw-r--r--block/blk-flush.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blk-flush.c b/block/blk-flush.c
index 720ad607ff91..db8f1b507857 100644
--- a/block/blk-flush.c
+++ b/block/blk-flush.c
@@ -436,7 +436,7 @@ int blkdev_issue_flush(struct block_device *bdev, gfp_t gfp_mask,
436 436
437 bio_get(bio); 437 bio_get(bio);
438 submit_bio(WRITE_FLUSH, bio); 438 submit_bio(WRITE_FLUSH, bio);
439 wait_for_completion(&wait); 439 wait_for_completion_io(&wait);
440 440
441 /* 441 /*
442 * The driver must store the error location in ->bi_sector, if 442 * The driver must store the error location in ->bi_sector, if