diff options
| author | Aristeu Rozanski <aris@ruivo.org> | 2026-08-27 21:55:43 -0400 |
|---|---|---|
| committer | David Hildenbrand (Arm) <david@kernel.org> | 2026-09-14 09:53:53 +0200 |
| commit | d091e2cfc9b05d7745b3d2845590f5c91361cf40 (patch) | |
| tree | 99098b7e19a433129706ba83de8a32fe40cef2a6 /mm | |
| parent | df2908090cda368b01ff43709f51890076c56157 (diff) | |
| download | linux-next-d091e2cfc9b05d7745b3d2845590f5c91361cf40.tar.gz linux-next-d091e2cfc9b05d7745b3d2845590f5c91361cf40.zip | |
mm: gup: move pmd_protnone() into gup_fast_pmd_leaf()
Make pmd handling match pud handling by calling pmd_protnone()
inside gup_fast_pmd_leaf().
Suggested-by: David Hildenbrand <david@kernel.org>
Link: https://lore.kernel.org/all/85e760cf-b994-40db-8d13-221feee55c60@redhat.com/T/#u
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: David Hildenbrand <david@kernel.org>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Peter Xu <peterx@redhat.com>
Signed-off-by: Aristeu Rozanski <aris@ruivo.org>
Link: https://patch.msgid.link/20260828015542.245315718@ruivo.org
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Diffstat (limited to 'mm')
| -rw-r--r-- | mm/gup.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -2929,6 +2929,10 @@ static int gup_fast_pmd_leaf(pmd_t orig, pmd_t *pmdp, unsigned long addr, struct folio *folio; int refs; + /* See gup_fast_pte_range() */ + if (pmd_protnone(orig)) + return 0; + if (!pmd_access_permitted(orig, flags & FOLL_WRITE)) return 0; @@ -3024,10 +3028,6 @@ static int gup_fast_pmd_range(pud_t *pudp, pud_t pud, unsigned long addr, return 0; if (unlikely(pmd_leaf(pmd))) { - /* See gup_fast_pte_range() */ - if (pmd_protnone(pmd)) - return 0; - if (!gup_fast_pmd_leaf(pmd, pmdp, addr, next, flags, pages, nr)) return 0; |
