Skip to content

Commit 14a7f23

Browse files
Yonghong SongAlexei Starovoitov
authored andcommitted
bpf: Make migrate_disable always inline to avoid partial inlining
The build fails with llvm 21/22: $ make LLVM=1 -j ... LD vmlinux.o GEN .vmlinux.objs ... BTF .tmp_vmlinux1.btf.o ... AS .tmp_vmlinux2.kallsyms.o LD vmlinux.unstripped BTFIDS vmlinux.unstripped WARN: resolve_btfids: unresolved symbol migrate_enable WARN: resolve_btfids: unresolved symbol migrate_disable make[2]: *** [vmlinux.unstripped] Error 255 make[2]: *** Deleting file 'vmlinux.unstripped' make[1]: *** [Makefile:1242: vmlinux] Error 2 make: *** [Makefile:248: __sub-make] Error 2 Two functions with identical names but different addresses are considered ambiguous and removed by "pahole" from vmlinux BTF. Later resolve_btfids warns since it cannot find them. Commit 378b770 ("sched: Make migrate_{en,dis}able() inline") made them inlineable in most places, but in vmlinux built with llvm 21 and 22 there are four symbols for migrate_{enable,disable}: three static functions and one global function. Fix the issue by marking migrate_{enable,disable} as always inline. The alternative is to mark them as notrace/nokprobe which is more drastic. Only bpf programs are prevented from attaching to these functions. The rest of the tracing shouldn't be affected. [note: Peter ok-ed the patch, Alexei rewrote commit log] Fixes: 378b770 ("sched: Make migrate_{en,dis}able() inline") Signed-off-by: Yonghong Song <yonghong.song@linux.dev> Acked-by: Menglong Dong <menglong.dong@linux.dev> Link: https://lore.kernel.org/r/20251029183646.3811774-1-yonghong.song@linux.dev Signed-off-by: Alexei Starovoitov <ast@kernel.org>
1 parent 2cbb259 commit 14a7f23

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/linux/sched.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2407,12 +2407,12 @@ static inline void __migrate_enable(void) { }
24072407
* be defined in kernel/sched/core.c.
24082408
*/
24092409
#ifndef INSTANTIATE_EXPORTED_MIGRATE_DISABLE
2410-
static inline void migrate_disable(void)
2410+
static __always_inline void migrate_disable(void)
24112411
{
24122412
__migrate_disable();
24132413
}
24142414

2415-
static inline void migrate_enable(void)
2415+
static __always_inline void migrate_enable(void)
24162416
{
24172417
__migrate_enable();
24182418
}

0 commit comments

Comments
 (0)