The patch titled Subject: hugetlb: harmonize hugetlb.h arch specific defines with pgtable.h has been added to the -mm tree. Its filename is hugetlb-harmonize-hugetlbh-arch-specific-defines-with-pgtableh.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/hugetlb-harmonize-hugetlbh-arch-specific-defines-with-pgtableh.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/hugetlb-harmonize-hugetlbh-arch-specific-defines-with-pgtableh.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Alexandre Ghiti <alex@xxxxxxxx> Subject: hugetlb: harmonize hugetlb.h arch specific defines with pgtable.h In order to reduce copy/paste of functions across architectures and then make riscv hugetlb port (and future ports) simpler and smaller, this patchset intends to factorize the numerous hugetlb primitives that are defined across all the architectures. Except for prepare_hugepage_range, this patchset moves the versions that are just pass-through to standard pte primitives into asm-generic/hugetlb.h by using the same #ifdef semantic that can be found in asm-generic/pgtable.h, i.e. __HAVE_ARCH_***. s390 architecture has not been tackled in this serie since it does not use asm-generic/hugetlb.h at all. This patchset has been compiled on all addressed architectures with success (except for parisc, but the problem does not come from this series). This patch (of 11): asm-generic/hugetlb.h proposes generic implementations of hugetlb related functions: use __HAVE_ARCH_HUGE* defines in order to make arch specific implementations of hugetlb functions consistent with pgtable.h scheme. Link: http://lkml.kernel.org/r/20180920060358.16606-2-alex@xxxxxxxx Signed-off-by: Alexandre Ghiti <alex@xxxxxxxx> Reviewed-by: Luiz Capitulino <lcapitulino@xxxxxxxxxx> Reviewed-by: Mike Kravetz <mike.kravetz@xxxxxxxxxx> Acked-by: Catalin Marinas <catalin.marinas@xxxxxxx> [arm64] Cc: Russell King <linux@xxxxxxxxxxxxxxx> Cc: Will Deacon <will.deacon@xxxxxxx> Cc: Tony Luck <tony.luck@xxxxxxxxx> Cc: Fenghua Yu <fenghua.yu@xxxxxxxxx> Cc: Ralf Baechle <ralf@xxxxxxxxxxxxxx> Cc: Paul Burton <paul.burton@xxxxxxxx> Cc: James Hogan <jhogan@xxxxxxxxxx> Cc: James E.J. Bottomley <jejb@xxxxxxxxxxxxxxxx> Cc: Helge Deller <deller@xxxxxx> Cc: Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx> Cc: Paul Mackerras <paulus@xxxxxxxxx> Cc: Michael Ellerman <mpe@xxxxxxxxxxxxxx> Cc: Yoshinori Sato <ysato@xxxxxxxxxxxxxxxxxxxx> Cc: Rich Felker <dalias@xxxxxxxx> Cc: David S. Miller <davem@xxxxxxxxxxxxx> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxxxxx> Cc: H. Peter Anvin <hpa@xxxxxxxxx> Cc: Arnd Bergmann <arnd@xxxxxxxx> Cc: Martin Schwidefsky <schwidefsky@xxxxxxxxxx> Cc: Heiko Carstens <heiko.carstens@xxxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxxxxx> [x86] Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- arch/arm64/include/asm/hugetlb.h | 2 +- include/asm-generic/hugetlb.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) --- a/arch/arm64/include/asm/hugetlb.h~hugetlb-harmonize-hugetlbh-arch-specific-defines-with-pgtableh +++ a/arch/arm64/include/asm/hugetlb.h @@ -81,9 +81,9 @@ extern void huge_ptep_set_wrprotect(stru unsigned long addr, pte_t *ptep); extern void huge_ptep_clear_flush(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep); +#define __HAVE_ARCH_HUGE_PTE_CLEAR extern void huge_pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep, unsigned long sz); -#define huge_pte_clear huge_pte_clear extern void set_huge_swap_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pte, unsigned long sz); #define set_huge_swap_pte_at set_huge_swap_pte_at --- a/include/asm-generic/hugetlb.h~hugetlb-harmonize-hugetlbh-arch-specific-defines-with-pgtableh +++ a/include/asm-generic/hugetlb.h @@ -32,7 +32,7 @@ static inline pte_t huge_pte_modify(pte_ return pte_modify(pte, newprot); } -#ifndef huge_pte_clear +#ifndef __HAVE_ARCH_HUGE_PTE_CLEAR static inline void huge_pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep, unsigned long sz) { _ Patches currently in -mm which might be from alex@xxxxxxxx are hugetlb-harmonize-hugetlbh-arch-specific-defines-with-pgtableh.patch hugetlb-introduce-generic-version-of-hugetlb_free_pgd_range.patch hugetlb-introduce-generic-version-of-set_huge_pte_at.patch hugetlb-introduce-generic-version-of-huge_ptep_get_and_clear.patch hugetlb-introduce-generic-version-of-huge_ptep_clear_flush.patch hugetlb-introduce-generic-version-of-huge_pte_none.patch hugetlb-introduce-generic-version-of-huge_pte_wrprotect.patch hugetlb-introduce-generic-version-of-prepare_hugepage_range.patch hugetlb-introduce-generic-version-of-huge_ptep_set_wrprotect.patch hugetlb-introduce-generic-version-of-huge_ptep_set_access_flags.patch hugetlb-introduce-generic-version-of-huge_ptep_get.patch