summaryrefslogtreecommitdiffstats
path: root/mm/khugepaged.c
diff options
context:
space:
mode:
authorShaohua Li <shli@fb.com>2017-05-03 17:52:26 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-05-03 18:52:08 -0400
commitd44d363f65780f2ac2ec672164555af54896d40d (patch)
treebcac8f8737c3c9c2647afe02d904ca4f00c50f24 /mm/khugepaged.c
parenta128ca71fb29ed4444b80f38a0148b468826e19b (diff)
mm: don't assume anonymous pages have SwapBacked flag
There are a few places the code assumes anonymous pages should have SwapBacked flag set. MADV_FREE pages are anonymous pages but we are going to add them to LRU_INACTIVE_FILE list and clear SwapBacked flag for them. The assumption doesn't hold any more, so fix them. Link: http://lkml.kernel.org/r/3945232c0df3dd6c4ef001976f35a95f18dcb407.1487965799.git.shli@fb.com Signed-off-by: Shaohua Li <shli@fb.com> Acked-by: Johannes Weiner <hannes@cmpxchg.org> Acked-by: Hillf Danton <hillf.zj@alibaba-inc.com> Cc: Michal Hocko <mhocko@suse.com> Cc: Minchan Kim <minchan@kernel.org> Cc: Hugh Dickins <hughd@google.com> Cc: Rik van Riel <riel@redhat.com> Cc: Mel Gorman <mgorman@techsingularity.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/khugepaged.c')
-rw-r--r--mm/khugepaged.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/mm/khugepaged.c b/mm/khugepaged.c
index ba40b7f673f4..88e4b1737c90 100644
--- a/mm/khugepaged.c
+++ b/mm/khugepaged.c
@@ -483,8 +483,7 @@ void __khugepaged_exit(struct mm_struct *mm)
483 483
484static void release_pte_page(struct page *page) 484static void release_pte_page(struct page *page)
485{ 485{
486 /* 0 stands for page_is_file_cache(page) == false */ 486 dec_node_page_state(page, NR_ISOLATED_ANON + page_is_file_cache(page));
487 dec_node_page_state(page, NR_ISOLATED_ANON + 0);
488 unlock_page(page); 487 unlock_page(page);
489 putback_lru_page(page); 488 putback_lru_page(page);
490} 489}
@@ -532,7 +531,6 @@ static int __collapse_huge_page_isolate(struct vm_area_struct *vma,
532 531
533 VM_BUG_ON_PAGE(PageCompound(page), page); 532 VM_BUG_ON_PAGE(PageCompound(page), page);
534 VM_BUG_ON_PAGE(!PageAnon(page), page); 533 VM_BUG_ON_PAGE(!PageAnon(page), page);
535 VM_BUG_ON_PAGE(!PageSwapBacked(page), page);
536 534
537 /* 535 /*
538 * We can do it before isolate_lru_page because the 536 * We can do it before isolate_lru_page because the
@@ -579,8 +577,8 @@ static int __collapse_huge_page_isolate(struct vm_area_struct *vma,
579 result = SCAN_DEL_PAGE_LRU; 577 result = SCAN_DEL_PAGE_LRU;
580 goto out; 578 goto out;
581 } 579 }
582 /* 0 stands for page_is_file_cache(page) == false */ 580 inc_node_page_state(page,
583 inc_node_page_state(page, NR_ISOLATED_ANON + 0); 581 NR_ISOLATED_ANON + page_is_file_cache(page));
584 VM_BUG_ON_PAGE(!PageLocked(page), page); 582 VM_BUG_ON_PAGE(!PageLocked(page), page);
585 VM_BUG_ON_PAGE(PageLRU(page), page); 583 VM_BUG_ON_PAGE(PageLRU(page), page);
586 584