mm-mlock-implement-folio_mlock_step-using-folio_pte_batch.patch removed from -mm tree
The quilt patch titled
Subject: mm/mlock: implement folio_mlock_step() using folio_pte_batch()
has been removed from the -mm tree. Its filename was
mm-mlock-implement-folio_mlock_step-using-folio_pte_batch.patch
This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Lance Yang <[email protected]>
Subject: mm/mlock: implement folio_mlock_step() using folio_pte_batch()
Date: Tue, 11 Jun 2024 09:04:18 +0800
Let's make folio_mlock_step() simply a wrapper around folio_pte_batch(), which will greatly reduce the cost of ptep_get() when scanning a range of contptes.
---
mm/mlock.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-)
mm/mlock.c renamed from mm/mlock.c~mm-mlock-implement-folio_mlock_step-using-folio_pte_batch +4 -15
@@ -307,26 +307,15 @@ void munlock_folio(struct folio *folio)static inline unsigned int folio_mlock_step (struct folio *folio,pte_t *pte,unsigned long addr,unsigned long end) { -unsigned int count, i, nr =folio_nr_pages (folio); -unsigned long pfn =folio_pfn (folio); +const fpb_t fpb_flags =FPB_IGNORE_DIRTY |FPB_IGNORE_SOFT_DIRTY ; +unsigned int count = (end - addr) >>PAGE_SHIFT ;pte_t ptent =ptep_get (pte);if (!folio_test_large (folio))return 1 ; - count = pfn + nr -pte_pfn (ptent); - count = min_t(unsigned int, count, (end - addr) >> PAGE_SHIFT); - -for (i =0 ; i < count; i++, pte++) { -pte_t entry =ptep_get (pte); - -if (!pte_present (entry)) -break ; -if (pte_pfn (entry) - pfn >= nr) -break ; - } - -return i; +return folio_pte_batch (folio, addr, pte, ptent, count, fpb_flags,NULL , +NULL ,NULL ); } static inline bool allow_mlock_munlock(struct folio *folio,
_
Patches currently in -mm which might be from [email protected] are