From: Weijie Yang Date: Tue, 12 Nov 2013 23:07:52 +0000 (-0800) Subject: mm/zswap: avoid unnecessary page scanning X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=b349acc76b7f65400b85abd09a5379ddd6fa5a97;p=openwrt%2Fstaging%2Fblogic.git mm/zswap: avoid unnecessary page scanning Add SetPageReclaim() before __swap_writepage() so that page can be moved to the tail of the inactive list, which can avoid unnecessary page scanning as this page was reclaimed by swap subsystem before. Signed-off-by: Weijie Yang Reviewed-by: Bob Liu Reviewed-by: Minchan Kim Acked-by: Seth Jennings Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/zswap.c b/mm/zswap.c index d93510c6aa2d..001474c1a594 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -556,6 +556,9 @@ static int zswap_writeback_entry(struct zbud_pool *pool, unsigned long handle) SetPageUptodate(page); } + /* move it to the tail of the inactive list after end_writeback */ + SetPageReclaim(page); + /* start writeback */ __swap_writepage(page, &wbc, end_swap_bio_write); page_cache_release(page);