[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181214062754.13723-2-ying.huang@intel.com>
Date: Fri, 14 Dec 2018 14:27:34 +0800
From: Huang Ying <ying.huang@...el.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Huang Ying <ying.huang@...el.com>,
Vineeth Remanan Pillai <vpillai@...italocean.com>,
Kelley Nielsen <kelleynnn@...il.com>,
Rik van Riel <riel@...riel.com>,
Matthew Wilcox <willy@...radead.org>,
Hugh Dickins <hughd@...gle.com>
Subject: [PATCH -V9 01/21] swap: Deal with PTE mapped THP when unuse PTE
A PTE swap entry may map to a normal swap slot inside a huge swap
cluster. To free the huge swap cluster and the corresponding
THP (transparent huge page), all PTE swap entry mappings need to be
unmapped. The original implementation only checks current PTE swap
entry mapping, this is fixed via calling try_to_free_swap() instead,
which will check all PTE swap mappings inside the huge swap cluster.
This fix could be folded into the patch: mm, swap: rid swapoff of
quadratic complexity in -mm patchset.
Signed-off-by: "Huang, Ying" <ying.huang@...el.com>
Cc: Vineeth Remanan Pillai <vpillai@...italocean.com>
Cc: Kelley Nielsen <kelleynnn@...il.com>
Cc: Rik van Riel <riel@...riel.com>
Cc: Matthew Wilcox <willy@...radead.org>
Cc: Hugh Dickins <hughd@...gle.com>
---
mm/swapfile.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 7464d0a92869..9e6da494781f 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -1921,10 +1921,8 @@ static int unuse_pte_range(struct vm_area_struct *vma, pmd_t *pmd,
goto out;
}
- if (PageSwapCache(page) && (swap_count(*swap_map) == 0))
- delete_from_swap_cache(compound_head(page));
+ try_to_free_swap(page);
- SetPageDirty(page);
unlock_page(page);
put_page(page);
--
2.18.1
Powered by blists - more mailing lists