Skip to content

Commit 821ed6b

Browse files
Minchan Kimtorvalds
authored andcommitted
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 <kosaki.motohiro@jp.fujitsu.com> Signed-off-by: Minchan Kim <minchan.kim@gmail.com> Reviewed-by: Rik van Riel<riel@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 2cbea1d commit 821ed6b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

mm/swap.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,13 @@ static void drain_cpu_pagevecs(int cpu)
476476
*/
477477
void deactivate_page(struct page *page)
478478
{
479+
/*
480+
* In a workload with many unevictable page such as mprotect, unevictable
481+
* page deactivation for accelerating reclaim is pointless.
482+
*/
483+
if (PageUnevictable(page))
484+
return;
485+
479486
if (likely(get_page_unless_zero(page))) {
480487
struct pagevec *pvec = &get_cpu_var(lru_deactivate_pvecs);
481488

0 commit comments

Comments
 (0)