From: Minchan Kim Date: Wed, 25 May 2011 00:12:31 +0000 (-0700) Subject: mm: filter unevictable page out in deactivate_page() X-Git-Tag: MMI-PSA29.97-13-9~19553 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=821ed6bbed3cf41c4050a431eeb822b33868d36a;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git mm: filter unevictable page out in deactivate_page() It's pointless that deactive_page's operates on unevictable pages. This patch removes unnecessary overhead which might be a bit problem in case that there are many unevictable page in system(ex, mprotect workload) [akpm@linux-foundation.org: tidy up comment] Reviewed-by: KOSAKI Motohiro Signed-off-by: Minchan Kim Reviewed-by: Rik van Riel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/swap.c b/mm/swap.c index 5602f1a1b1e7..2f365d1a4bb2 100644 --- a/mm/swap.c +++ b/mm/swap.c @@ -476,6 +476,13 @@ static void drain_cpu_pagevecs(int cpu) */ void deactivate_page(struct page *page) { + /* + * In a workload with many unevictable page such as mprotect, unevictable + * page deactivation for accelerating reclaim is pointless. + */ + if (PageUnevictable(page)) + return; + if (likely(get_page_unless_zero(page))) { struct pagevec *pvec = &get_cpu_var(lru_deactivate_pvecs);