From 4f4e3a58d84d80a66ba77a0069633bc922143353 Mon Sep 17 00:00:00 2001 From: Yu Zhao Date: Wed, 11 Nov 2020 15:39:48 +0800 Subject: [PATCH 2385/2944] mm: remove activate_page() from unuse_pte() task #30476868 commit cc2828b21c764f901128ca2e7b9f056d0e72104f upstream We don't initially add anon pages to active lruvec after commit b518154e59aa ("mm/vmscan: protect the workingset on anonymous LRU"). Remove activate_page() from unuse_pte(), which seems to be missed by the commit. And make the function static while we are at it. Before the commit, we called lru_cache_add_active_or_unevictable() to add new ksm pages to active lruvec. Therefore, activate_page() wasn't necessary for them in the first place. There some different with upstream patch. We fails to make activate_page static. Because commit b56a2d8af914 ("mm: rid swapoff of quadratic complexity") has not applied yet, and it has a lot of modifications. Signed-off-by: Yu Zhao Signed-off-by: Andrew Morton Reviewed-by: Yang Shi Cc: Alexander Duyck Cc: Huang Ying Cc: David Hildenbrand Cc: Michal Hocko Cc: Qian Cai Cc: Mel Gorman Cc: Nicholas Piggin Cc: Hugh Dickins Cc: Joonsoo Kim Link: http://lkml.kernel.org/r/20200818184704.3625199-1-yuzhao@google.com Signed-off-by: Linus Torvalds Signed-off-by: zhongjiang-ali Reviewed-by: Xunlei Pang --- mm/swapfile.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/mm/swapfile.c b/mm/swapfile.c index a606341..36ecc43 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -1868,11 +1868,6 @@ static int unuse_pte(struct vm_area_struct *vma, pmd_t *pmd, lru_cache_add_inactive_or_unevictable(page, vma); } swap_free(entry); - /* - * Move the page to the active list so it is not - * immediately swapped out again after swapon. - */ - activate_page(page); out: pte_unmap_unlock(pte, ptl); if (page != swapcache) { -- 1.8.3.1