The patch titled Subject: asm-generic/tlb: stub out p4d_free_tlb() if __PAGETABLE_P4D_FOLDED ... has been added to the -mm tree. Its filename is asm-generic-tlb-stub-out-p4d_free_tlb-if-__pagetable_p4d_folded.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/asm-generic-tlb-stub-out-p4d_free_tlb-if-__pagetable_p4d_folded.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/asm-generic-tlb-stub-out-p4d_free_tlb-if-__pagetable_p4d_folded.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: Vineet Gupta <Vineet.Gupta1@xxxxxxxxxxxx> Subject: asm-generic/tlb: stub out p4d_free_tlb() if __PAGETABLE_P4D_FOLDED ... ... independent of __ARCH_HAS_5LEVEL_HACK This came up when removing __ARCH_HAS_5LEVEL_HACK for ARC as code bloat from p4d_free_tlb() despite pud being folded (with 2 levels on ARC) | bloat-o-meter2 vmlinux-C-elide-pud_free_tlb vmlinux-D-elide-p4d_free_tl= b | add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-104 (-104) | function old new delta | free_pgd_range 552 422 -130 | Total: Before=3D4137172, After=3D4137042, chg -1.000000% Link: http://lkml.kernel.org/r/20191009222658.961-3-vgupta@xxxxxxxxxxxx Signed-off-by: Vineet Gupta <vgupta@xxxxxxxxxxxx> Acked-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx> Cc: Arnd Bergmann <arnd@xxxxxxxx> Cc: Will Deacon <will@xxxxxxxxxx> Cc: "Aneesh Kumar K . V" <aneesh.kumar@xxxxxxxxxxxxx> Cc: Nick Piggin <npiggin@xxxxxxxxx> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/asm-generic/5level-fixup.h | 2 -- include/asm-generic/tlb.h | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) --- a/include/asm-generic/5level-fixup.h~asm-generic-tlb-stub-out-p4d_free_tlb-if-__pagetable_p4d_folded +++ a/include/asm-generic/5level-fixup.h @@ -48,8 +48,6 @@ static inline int p4d_present(p4d_t p4d) #define __p4d(x) __pgd(x) #define set_p4d(p4dp, p4d) set_pgd(p4dp, p4d) -#undef p4d_free_tlb -#define p4d_free_tlb(tlb, x, addr) do { } while (0) #define p4d_free(mm, x) do { } while (0) #define __p4d_free_tlb(tlb, x, addr) do { } while (0) --- a/include/asm-generic/tlb.h~asm-generic-tlb-stub-out-p4d_free_tlb-if-__pagetable_p4d_folded +++ a/include/asm-generic/tlb.h @@ -598,7 +598,7 @@ static inline void tlb_end_vma(struct mm #define pud_free_tlb(tlb, pudp, address) do { } while (0) #endif -#ifndef __ARCH_HAS_5LEVEL_HACK +#ifndef __PAGETABLE_P4D_FOLDED #ifndef p4d_free_tlb #define p4d_free_tlb(tlb, pudp, address) \ do { \ @@ -607,6 +607,8 @@ static inline void tlb_end_vma(struct mm __p4d_free_tlb(tlb, pudp, address); \ } while (0) #endif +#else +#define p4d_free_tlb(tlb, pudp, address) do { } while (0) #endif #endif /* CONFIG_MMU */ _ Patches currently in -mm which might be from Vineet.Gupta1@xxxxxxxxxxxx are asm-generic-tlb-stub-out-pud_free_tlb-if-__pagetable_pud_folded.patch asm-generic-tlb-stub-out-p4d_free_tlb-if-__pagetable_p4d_folded.patch asm-generic-mm-stub-out-p4dd_clear_bad-if-__pagetable_p4ud_folded.patch