[PATCH 0/3] mm/gup: fixups for hugetlb gup rework series

From: peterx
Date: Tue Apr 02 2024 - 21:33:13 EST


From: Peter Xu <peterx@xxxxxxxxxx>

Hi,

This is a small patchset that will fix two known issues that got reported
today on the previous hugetlb unification series on slow gup [1].

The first issue was reported by Ryan Roberts [2] on a test failure over
gup_longterm. Patch 1-2 should fix it. Tested with 32MB hugepages on
arm64 VM.

The second issue was reported by Nathan Chancellor [3] on a build issue
over loongson's defconfig (loongson3_defconfig). It can be easily
reproduced with my own build setup [4], while patch 3 fixes it, and should
hopefully fix similar archs where pud_pfn() is not defined even if
pud_leaf() can return true.

For the 2nd issue, it's debatable whether it's an arch issue, because
logically speaking pud_pfn() and pud_leaf() should either be both defined
or both not. But since the current fix will be the simplest and still safe
(I at least checked loongarch doesn't support either pud dax or pud
hugetlb), I think we can consider having this to unbreak the build first,
assuming this could also happen to other archs.

One note is that the last 2 patches should be squashed into corresponding
patch, while the 1st patch should be kept standalone.

Thanks,

[1] https://lore.kernel.org/r/20240327152332.950956-1-peterx@xxxxxxxxxx
[2] https://lore.kernel.org/r/adfdd89b-ee56-4758-836e-c66a0be7de25@xxxxxxx
[3] https://lore.kernel.org/r/ZgyKLLVZ4vN56uZE@x1n
[4] https://gitlab.com/peterx/lkb-harness/-/blob/main/config.json?ref_type=heads#L32

Peter Xu (3):
mm: Allow anon exclusive check over hugetlb tail pages
fixup! mm/gup: handle huge pmd for follow_pmd_mask()
fixup! mm/arch: provide pud_pfn() fallback

include/linux/page-flags.h | 8 +++++++-
include/linux/pgtable.h | 6 +++++-
mm/gup.c | 3 ---
mm/internal.h | 10 ----------
4 files changed, 12 insertions(+), 15 deletions(-)

--
2.44.0