On Tue, 5 Jul 2022 at 16:45, Arnd Bergmann <arnd@xxxxxxxx> wrote: > > On Tue, Jul 5, 2022 at 10:38 AM Muchun Song <songmuchun@xxxxxxxxxxxxx> wrote: > > On Tue, Jul 5, 2022 at 4:06 PM Arnd Bergmann <arnd@xxxxxxxx> wrote: > > > On Tue, Jul 5, 2022 at 9:51 AM Muchun Song <songmuchun@xxxxxxxxxxxxx> wrote: > > > > How about including the static key header in the scope of > > CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP? > > That helps a little, but it means we still pay for it on x86 and > arm64, which are the > most common architectures. > Hi, Arnd, It seems that arm64 and x86 include static_key.h or jump_label.h in some more basic header files, otherwise they would not compile successfully when they including page-flags.h. In file included from ./arch/arm64/include/asm/lse.h:13, from ./arch/arm64/include/asm/cmpxchg.h:14, from ./arch/arm64/include/asm/atomic.h:16, from ./include/linux/atomic.h:7, from ./include/asm-generic/bitops/atomic.h:5, from ./arch/arm64/include/asm/bitops.h:25, from ./include/linux/bitops.h:33, from ./include/linux/log2.h:12, from kernel/bounds.c:13: ./include/linux/jump_label.h:5:2: error: #error "Hi" 5 | #error "Hi" In file included from ./arch/x86/include/asm/nospec-branch.h:6, from ./arch/x86/include/asm/paravirt_types.h:40, from ./arch/x86/include/asm/ptrace.h:97, from ./arch/x86/include/asm/math_emu.h:5, from ./arch/x86/include/asm/processor.h:13, from ./arch/x86/include/asm/cpufeature.h:5, from ./arch/x86/include/asm/thread_info.h:53, from ./include/linux/thread_info.h:60, from ./arch/x86/include/asm/preempt.h:7, from ./include/linux/preempt.h:78, from ./include/linux/spinlock.h:55, from ./include/linux/mmzone.h:8, from ./include/linux/gfp.h:6, from ./include/linux/slab.h:15, from ./include/linux/crypto.h:20, from arch/x86/kernel/asm-offsets.c:9: ./include/linux/static_key.h:3:2: error: #error "Hi" #error "Hi" ^~~~~ In file included from ./include/linux/tracepoint-defs.h:12, from ./arch/x86/include/asm/msr.h:58, from ./arch/x86/include/asm/processor.h:22, from ./arch/x86/include/asm/cpufeature.h:5, from ./arch/x86/include/asm/thread_info.h:53, from ./include/linux/thread_info.h:60, from ./arch/x86/include/asm/preempt.h:7, from ./include/linux/preempt.h:78, from ./include/linux/spinlock.h:55, from ./include/linux/mmzone.h:8, from ./include/linux/gfp.h:6, from ./include/linux/slab.h:15, from ./include/linux/crypto.h:20, from arch/x86/kernel/asm-offsets.c:9: ./include/linux/static_key.h:3:2: error: #error "Hi" #error "Hi" ^~~~~ In file included from ./include/linux/kasan-enabled.h:5, from ./include/linux/kasan.h:6, from ./include/linux/slab.h:140, from ./include/linux/crypto.h:20, from arch/x86/kernel/asm-offsets.c:9: ./include/linux/static_key.h:3:2: error: #error "Hi" #error "Hi" ^~~~~ In file included from ./include/linux/kasan.h:8, from ./include/linux/slab.h:140, from ./include/linux/crypto.h:20, from arch/x86/kernel/asm-offsets.c:9: ./include/linux/static_key.h:3:2: error: #error "Hi" #error "Hi" ^~~~~ In file included from ./include/linux/context_tracking_state.h:6, from ./include/linux/hardirq.h:5, from arch/x86/kernel/asm-offsets.c:12: ./include/linux/static_key.h:3:2: error: #error "Hi" #error "Hi" ^~~~~ In file included from ./include/linux/vmstat.h:10, from ./include/linux/mm.h:1771, from ./include/linux/memcontrol.h:20, from ./include/linux/swap.h:9, from ./include/linux/suspend.h:5, from arch/x86/kernel/asm-offsets.c:13: ./include/linux/static_key.h:3:2: error: #error "Hi" #error "Hi" Thanks, Feiyang > Arnd >