mm: make generic_writepages() use plugging
authorShaohua Li <shaohua.li@intel.com>
Thu, 17 Mar 2011 09:47:06 +0000 (10:47 +0100)
committerJens Axboe <jaxboe@fusionio.com>
Thu, 17 Mar 2011 09:47:06 +0000 (10:47 +0100)
This recovers a performance regression caused by the removal
of the per-device plugging.

Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
mm/page-writeback.c

index cc0ede169e41d3f3d9be3f78641ed1459fb5335a..24b7ac2bc36b558eace70cae46e5781ac304368f 100644 (file)
@@ -1039,11 +1039,17 @@ static int __writepage(struct page *page, struct writeback_control *wbc,
 int generic_writepages(struct address_space *mapping,
                       struct writeback_control *wbc)
 {
+       struct blk_plug plug;
+       int ret;
+
        /* deal with chardevs and other special file */
        if (!mapping->a_ops->writepage)
                return 0;
 
-       return write_cache_pages(mapping, wbc, __writepage, mapping);
+       blk_start_plug(&plug);
+       ret = write_cache_pages(mapping, wbc, __writepage, mapping);
+       blk_finish_plug(&plug);
+       return ret;
 }
 
 EXPORT_SYMBOL(generic_writepages);