From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from 69-171-232-181.mail-mxout.facebook.com (69-171-232-181.mail-mxout.facebook.com [69.171.232.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BBE36355046 for ; Wed, 29 Oct 2025 18:36:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=69.171.232.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761763024; cv=none; b=ugvmhyAUHX2iDSLl2dJbSF0rhLtPehu3fD+SM0+bxH7sRb4ucSBS/5czwInLjQ7HkDlRsfAH7wDfJhWYNVArMjDI6NBfmTDJphjDrEXb12alpIrdkgo/LxUo/S13ig6h0Ds8JD98SSUT1Kq2m8IU6AyKPbhwkjV8jgvOf7HNyt8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761763024; c=relaxed/simple; bh=ZOkMM2ph0ZER6+FvMuqEIdRndImcMBsPp9hLiMM32kk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=lkM89qol/KOsmyW894o2PyDIDemzk9Z2ibjR/sGmwytDc8ePEkguzZ8VB5I6fyPCbH1baJV1edgBhPbeSlKIIXHiMDjsL5341EUb4lHldnJ+pl4OOVVGJA5jbvD4TRoU+Viqec5BP8D9+KeZO3SQhOFS8zvzM0LvTV8bhtEzguE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.dev; spf=fail smtp.mailfrom=linux.dev; arc=none smtp.client-ip=69.171.232.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=linux.dev Received: by devvm16039.vll0.facebook.com (Postfix, from userid 128203) id 4941E1396F93F; Wed, 29 Oct 2025 11:36:46 -0700 (PDT) From: Yonghong Song To: bpf@vger.kernel.org Cc: Alexei Starovoitov , Andrii Nakryiko , Daniel Borkmann , kernel-team@fb.com, Martin KaFai Lau , Menglong Dong , Ihor Solodrai Subject: [PATCH bpf] bpf: Make migrate_{disable,enable} always inline if in header file Date: Wed, 29 Oct 2025 11:36:46 -0700 Message-ID: <20251029183646.3811774-1-yonghong.song@linux.dev> X-Mailer: git-send-email 2.47.3 Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable With latest bpf/bpf-next tree and latest pahole master, I got the followi= ng build failure: $ make LLVM=3D1 -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]: *** [/home/yhs/work/bpf-next/scripts/Makefile.vmlinux:72: vmli= nux.unstripped] Error 255 make[2]: *** Deleting file 'vmlinux.unstripped' make[1]: *** [/home/yhs/work/bpf-next/Makefile:1242: vmlinux] Error 2 make: *** [/home/yhs/work/bpf-next/Makefile:248: __sub-make] Error 2 In pahole patch [1], if two functions having identical names but differen= t addresses, then this function name is considered ambiguous and later on this function will not be added to vmlinux/module BTF. Commit 378b7708194f ("sched: Make migrate_{en,dis}able() inline") changed original global funcitons migrate_{enable,disable} to - in kernel/sched/core.c, migrate_{enable,disable} are global funcitons= . - in other places, migrate_{enable,disable} may survive as static funct= ions since they are marked as 'inline' in include/linux/sched.h and the 'inline' attribute does not garantee inlining. If I build with clang compiler (make LLVM=3D1 -j) (llvm21 and llvm22), I = found there are four symbols for migrate_{enable,disable} respectively, three static functions and one global function. With the above pahole patch [1]= , migrate_{enable,disable} are not in vmlinux BTF and this will cause later resolve_btfids failure. Making migrate_{enable,disable} always inline in include/linux/sched.h can fix the problem. [1] https://lore.kernel.org/dwarves/79a329ef-9bb3-454e-9135-731f2fd5195= 1@oracle.com/ Fixes: 378b7708194f ("sched: Make migrate_{en,dis}able() inline") Cc: Menglong Dong Cc: Ihor Solodrai Signed-off-by: Yonghong Song --- include/linux/sched.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/sched.h b/include/linux/sched.h index cbb7340c5866..b469878de25c 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -2407,12 +2407,12 @@ static inline void __migrate_enable(void) { } * be defined in kernel/sched/core.c. */ #ifndef INSTANTIATE_EXPORTED_MIGRATE_DISABLE -static inline void migrate_disable(void) +static __always_inline void migrate_disable(void) { __migrate_disable(); } =20 -static inline void migrate_enable(void) +static __always_inline void migrate_enable(void) { __migrate_enable(); } --=20 2.47.3