Skip to content

Commit 9b6096a

Browse files
Shaohua LiJens Axboe
authored andcommitted
mm: make generic_writepages() use plugging
This recovers a performance regression caused by the removal of the per-device plugging. Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
1 parent 167400d commit 9b6096a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎mm/page-writeback.c‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1039,11 +1039,17 @@ static int __writepage(struct page *page, struct writeback_control *wbc,
10391039
int generic_writepages(struct address_space *mapping,
10401040
struct writeback_control *wbc)
10411041
{
1042+
struct blk_plug plug;
1043+
int ret;
1044+
10421045
/* deal with chardevs and other special file */
10431046
if (!mapping->a_ops->writepage)
10441047
return 0;
10451048

1046-
return write_cache_pages(mapping, wbc, __writepage, mapping);
1049+
blk_start_plug(&plug);
1050+
ret = write_cache_pages(mapping, wbc, __writepage, mapping);
1051+
blk_finish_plug(&plug);
1052+
return ret;
10471053
}
10481054

10491055
EXPORT_SYMBOL(generic_writepages);

0 commit comments

Comments
 (0)