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

ARC: thp: unbork !CONFIG_TRANSPARENT_HUGEPAGE build

linux-next for 4.6-rc1 timeline reported ARC build failures !THP

| arch/arc/include/asm/tlbflush.h:29:0: warning: "flush_pmd_tlb_range" redefined [enabled by default]
| arch/arc/include/asm/tlbflush.h:29:0: warning: "flush_pmd_tlb_range" redefined [enabled by default]
| arch/arc/include/asm/tlbflush.h:29:0: warning: "flush_pmd_tlb_range" redefined [enabled by default]

Turns out that commit ("mm/thp/migration: switch from flush_tlb_range
to flush_pmd_tlb_range") triggered the issue while the problem was in
ARC code where THP specific helpers were not guarded with #ifdef.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>

+6 -1
+6 -1
arch/arc/include/asm/tlbflush.h
··· 17 17 void local_flush_tlb_kernel_range(unsigned long start, unsigned long end); 18 18 void local_flush_tlb_range(struct vm_area_struct *vma, 19 19 unsigned long start, unsigned long end); 20 + #ifdef CONFIG_TRANSPARENT_HUGEPAGE 20 21 void local_flush_pmd_tlb_range(struct vm_area_struct *vma, unsigned long start, 21 22 unsigned long end); 23 + #endif 22 24 23 25 #ifndef CONFIG_SMP 24 26 #define flush_tlb_range(vma, s, e) local_flush_tlb_range(vma, s, e) ··· 28 26 #define flush_tlb_kernel_range(s, e) local_flush_tlb_kernel_range(s, e) 29 27 #define flush_tlb_all() local_flush_tlb_all() 30 28 #define flush_tlb_mm(mm) local_flush_tlb_mm(mm) 29 + #ifdef CONFIG_TRANSPARENT_HUGEPAGE 31 30 #define flush_pmd_tlb_range(vma, s, e) local_flush_pmd_tlb_range(vma, s, e) 31 + #endif 32 32 #else 33 33 extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, 34 34 unsigned long end); ··· 38 34 extern void flush_tlb_kernel_range(unsigned long start, unsigned long end); 39 35 extern void flush_tlb_all(void); 40 36 extern void flush_tlb_mm(struct mm_struct *mm); 37 + #ifdef CONFIG_TRANSPARENT_HUGEPAGE 41 38 extern void flush_pmd_tlb_range(struct vm_area_struct *vma, unsigned long start, unsigned long end); 42 - 39 + #endif 43 40 #endif /* CONFIG_SMP */ 44 41 #endif