From: Weijie Yang Date: Tue, 5 Nov 2013 05:55:46 +0000 (+1100) Subject: mm/zswap: avoid unnecessary page scanning X-Git-Tag: next-20131105~2^2~230 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f67869fc7e8f4c5089bb96c037693fd33a29d12a;p=karo-tx-linux.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 --- 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);