Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mm/hugetlb: define a generic fallback for arch_clear_hugepage_flags()

There are multiple similar definitions for arch_clear_hugepage_flags() on
various platforms. Lets just add it's generic fallback definition for
platforms that do not override. This help reduce code duplication.

Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: Helge Deller <deller@gmx.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Link: http://lkml.kernel.org/r/1588907271-11920-4-git-send-email-anshuman.khandual@arm.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Anshuman Khandual and committed by
Linus Torvalds
5be99343 b0eae98c

+9 -28
+1
arch/arm/include/asm/hugetlb.h
··· 18 18 { 19 19 clear_bit(PG_dcache_clean, &page->flags); 20 20 } 21 + #define arch_clear_hugepage_flags arch_clear_hugepage_flags 21 22 22 23 #endif /* _ASM_ARM_HUGETLB_H */
+1
arch/arm64/include/asm/hugetlb.h
··· 21 21 { 22 22 clear_bit(PG_dcache_clean, &page->flags); 23 23 } 24 + #define arch_clear_hugepage_flags arch_clear_hugepage_flags 24 25 25 26 extern pte_t arch_make_huge_pte(pte_t entry, struct vm_area_struct *vma, 26 27 struct page *page, int writable);
-4
arch/ia64/include/asm/hugetlb.h
··· 28 28 { 29 29 } 30 30 31 - static inline void arch_clear_hugepage_flags(struct page *page) 32 - { 33 - } 34 - 35 31 #include <asm-generic/hugetlb.h> 36 32 37 33 #endif /* _ASM_IA64_HUGETLB_H */
-4
arch/mips/include/asm/hugetlb.h
··· 75 75 return changed; 76 76 } 77 77 78 - static inline void arch_clear_hugepage_flags(struct page *page) 79 - { 80 - } 81 - 82 78 #include <asm-generic/hugetlb.h> 83 79 84 80 #endif /* __ASM_HUGETLB_H */
-4
arch/parisc/include/asm/hugetlb.h
··· 42 42 unsigned long addr, pte_t *ptep, 43 43 pte_t pte, int dirty); 44 44 45 - static inline void arch_clear_hugepage_flags(struct page *page) 46 - { 47 - } 48 - 49 45 #include <asm-generic/hugetlb.h> 50 46 51 47 #endif /* _ASM_PARISC64_HUGETLB_H */
-4
arch/powerpc/include/asm/hugetlb.h
··· 61 61 unsigned long addr, pte_t *ptep, 62 62 pte_t pte, int dirty); 63 63 64 - static inline void arch_clear_hugepage_flags(struct page *page) 65 - { 66 - } 67 - 68 64 #include <asm-generic/hugetlb.h> 69 65 70 66 #else /* ! CONFIG_HUGETLB_PAGE */
-4
arch/riscv/include/asm/hugetlb.h
··· 5 5 #include <asm-generic/hugetlb.h> 6 6 #include <asm/page.h> 7 7 8 - static inline void arch_clear_hugepage_flags(struct page *page) 9 - { 10 - } 11 - 12 8 #endif /* _ASM_RISCV_HUGETLB_H */
+1
arch/s390/include/asm/hugetlb.h
··· 39 39 { 40 40 clear_bit(PG_arch_1, &page->flags); 41 41 } 42 + #define arch_clear_hugepage_flags arch_clear_hugepage_flags 42 43 43 44 static inline void huge_pte_clear(struct mm_struct *mm, unsigned long addr, 44 45 pte_t *ptep, unsigned long sz)
+1
arch/sh/include/asm/hugetlb.h
··· 30 30 { 31 31 clear_bit(PG_dcache_clean, &page->flags); 32 32 } 33 + #define arch_clear_hugepage_flags arch_clear_hugepage_flags 33 34 34 35 #include <asm-generic/hugetlb.h> 35 36
-4
arch/sparc/include/asm/hugetlb.h
··· 47 47 return changed; 48 48 } 49 49 50 - static inline void arch_clear_hugepage_flags(struct page *page) 51 - { 52 - } 53 - 54 50 #define __HAVE_ARCH_HUGETLB_FREE_PGD_RANGE 55 51 void hugetlb_free_pgd_range(struct mmu_gather *tlb, unsigned long addr, 56 52 unsigned long end, unsigned long floor,
-4
arch/x86/include/asm/hugetlb.h
··· 7 7 8 8 #define hugepages_supported() boot_cpu_has(X86_FEATURE_PSE) 9 9 10 - static inline void arch_clear_hugepage_flags(struct page *page) 11 - { 12 - } 13 - 14 10 #endif /* _ASM_X86_HUGETLB_H */
+5
include/linux/hugetlb.h
··· 600 600 #define is_hugepage_only_range is_hugepage_only_range 601 601 #endif 602 602 603 + #ifndef arch_clear_hugepage_flags 604 + static inline void arch_clear_hugepage_flags(struct page *page) { } 605 + #define arch_clear_hugepage_flags arch_clear_hugepage_flags 606 + #endif 607 + 603 608 #ifndef arch_make_huge_pte 604 609 static inline pte_t arch_make_huge_pte(pte_t entry, struct vm_area_struct *vma, 605 610 struct page *page, int writable)