mm-gup-remove-record_subpages.patch removed from -mm tree
The quilt patch titled
Subject: mm/gup: remove record_subpages()
has been removed from the -mm tree. Its filename was
mm-gup-remove-record_subpages.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: David Hildenbrand <[email protected]>
Subject: mm/gup: remove record_subpages()
Date: Mon, 1 Sep 2025 17:03:40 +0200
We can just cleanup the code by calculating the #refs earlier, so we can just inline what remains of record_subpages().
Calculate the number of references/pages ahead of times, and record them only once all our tests passed.
---
mm/gup.c | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-)
mm/gup.c renamed from mm/gup.c~mm-gup-remove-record_subpages +10 -17
@@ -484,19 +484,6 @@ static inline void mm_set_has_pinned_fla#ifdef CONFIG_MMU #ifdef CONFIG_HAVE_GUP_FAST -static int record_subpages (struct page *page,unsigned long sz, -unsigned long addr,unsigned long end, -struct page **pages) -{ -int nr; - - page += (addr & (sz -1 )) >>PAGE_SHIFT ; -for (nr =0 ; addr != end; nr++, addr +=PAGE_SIZE ) - pages[nr] = page++; - -return nr; -} -/** * try_grab_folio_fast() - Attempt to get or pin a folio in fast path. * @page: pointer to page to be grabbed
@@ -2971,8 +2958,8 @@ static int gup_fast_pmd_leaf(pmd_t orig,if (pmd_special (orig))return 0 ; - page =pmd_page (orig); - refs =record_subpages (page,PMD_SIZE , addr, end, pages + *nr); + refs = (end - addr) >>PAGE_SHIFT ; + page =pmd_page (orig) + ((addr & ~PMD_MASK ) >>PAGE_SHIFT ); folio =try_grab_folio_fast (page, refs, flags);if (!folio)
@@ -2992,7 +2979,10 @@ static int gup_fast_pmd_leaf(pmd_t orig,return 0 ; } + pages += *nr; *nr += refs; +for (; refs; refs--) + *(pages++) = page++;folio_set_referenced (folio);return 1 ; }
@@ -3011,8 +3001,8 @@ static int gup_fast_pud_leaf(pud_t orig,if (pud_special (orig))return 0 ; - page =pud_page (orig); - refs =record_subpages (page,PUD_SIZE , addr, end, pages + *nr); + refs = (end - addr) >>PAGE_SHIFT ; + page =pud_page (orig) + ((addr & ~PUD_MASK ) >>PAGE_SHIFT ); folio =try_grab_folio_fast (page, refs, flags);if (!folio)
@@ -3033,7 +3023,10 @@ static int gup_fast_pud_leaf(pud_t orig,return 0 ; } + pages += *nr; *nr += refs; +for (; refs; refs--) + *(pages++) = page++;folio_set_referenced (folio);return 1 ; }
_
Patches currently in -mm which might be from [email protected] are