Skip to content

Commit

Permalink
mm: make generic_writepages() use plugging
Browse files Browse the repository at this point in the history
This recovers a performance regression caused by the removal
of the per-device plugging.

Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Shaohua Li authored and Jens Axboe committed Mar 17, 2011
1 parent 167400d commit 9b6096a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mm/page-writeback.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9b6096a

Please sign in to comment.