The patch titled dio: call blk_run_address_space() once per op has been added to the -mm tree. Its filename is dio-call-blk_run_address_space-once-per-op.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: dio: call blk_run_address_space() once per op From: Zach Brown <zach.brown@xxxxxxxxxx> We only need to call blk_run_address_space() once after all the bios for the direct IO op have been submitted. This removes the chance of calling blk_run_address_space() after spurious wake ups as the sync path waits for bios to drain. It's also one less difference betwen the sync and async paths. In the process we remove a redundant dio_bio_submit() that its caller had already performed. Signed-off-by: Zach Brown <zach.brown@xxxxxxxxxx> Cc: Badari Pulavarty <pbadari@xxxxxxxxxx> Cc: Suparna Bhattacharya <suparna@xxxxxxxxxx> Acked-by: Jeff Moyer <jmoyer@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- fs/direct-io.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-) diff -puN fs/direct-io.c~dio-call-blk_run_address_space-once-per-op fs/direct-io.c --- a/fs/direct-io.c~dio-call-blk_run_address_space-once-per-op +++ a/fs/direct-io.c @@ -403,7 +403,6 @@ static struct bio *dio_await_one(struct if (dio->bio_list == NULL) { dio->waiter = current; spin_unlock_irqrestore(&dio->bio_lock, flags); - blk_run_address_space(dio->inode->i_mapping); io_schedule(); spin_lock_irqsave(&dio->bio_lock, flags); dio->waiter = NULL; @@ -449,9 +448,6 @@ static int dio_bio_complete(struct dio * */ static void dio_await_completion(struct dio *dio) { - if (dio->bio) - dio_bio_submit(dio); - /* * The bio_lock is not held for the read of bio_count. * This is ok since it is the dio_bio_complete() that changes @@ -1077,6 +1073,9 @@ direct_io_worker(int rw, struct kiocb *i if (dio->bio) dio_bio_submit(dio); + /* All IO is now issued, send it on its way */ + blk_run_address_space(inode->i_mapping); + /* * It is possible that, we return short IO due to end of file. * In that case, we need to release all the pages we got hold on. @@ -1105,7 +1104,6 @@ direct_io_worker(int rw, struct kiocb *i if (ret == 0) ret = dio->result; finished_one_bio(dio); /* This can free the dio */ - blk_run_address_space(inode->i_mapping); if (should_wait) { unsigned long flags; /* _ Patches currently in -mm which might be from zach.brown@xxxxxxxxxx are origin.patch pr_debug-aio-use-size_t-length-modifier-in-pr_debug-format-arguments.patch pr_debug-configfs-use-size_t-length-modifier-in-pr_debug-format-argument.patch pr_debug-sysfs-use-size_t-length-modifier-in-pr_debug-format-arguments.patch pr_debug-umem-repair-nonexistant-bh-pr_debug-reference.patch pr_debug-tipar-repair-nonexistant-pr_debug-argument-use.patch pr_debug-dell_rbu-fix-pr_debug-argument-warnings.patch pr_debug-ifb-replace-missing-comma-to-separate-pr_debug-arguments.patch pr_debug-trident-use-size_t-length-modifier-in-pr_debug-format-arguments.patch pr_debug-check-pr_debug-arguments-arm-fix.patch isdn-debug-build-fix.patch isdn-more-pr_debug-fixes.patch pr_debug-check-pr_debug-arguments.patch dio-centralize-completion-in-dio_complete.patch dio-call-blk_run_address_space-once-per-op.patch dio-formalize-bio-counters-as-a-dio-reference-count.patch dio-remove-duplicate-bio-wait-code.patch dio-only-call-aio_complete-after-returning-eiocbqueued.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html