From: Andrii Nakryiko <andrii@kernel.org>
To: <akpm@linux-foundation.org>
Cc: <bpf@vger.kernel.org>, <mgorman@techsingularity.net>,
<msuchanek@suse.de>, <linux-kernel@vger.kernel.org>,
<linux-mm@kvack.org>, <hritikxx8@gmail.com>, <jolsa@kernel.org>,
<kernel-team@fb.com>, Andrii Nakryiko <andrii@kernel.org>,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Hao Luo <haoluo@google.com>
Subject: [PATCH] kbuild: skip per-CPU BTF generation for pahole v1.18-v1.21
Date: Sat, 29 May 2021 17:25:36 -0700 [thread overview]
Message-ID: <20210530002536.3193829-1-andrii@kernel.org> (raw)
Commit "mm/page_alloc: convert per-cpu list protection to local_lock"
introduced a zero-sized per-CPU variable, which causes pahole to generate
invalid BTF. Only pahole versions 1.18 through 1.21 are impacted, as before
1.18 pahole doesn't know anything about per-CPU variables, and 1.22 contains
the proper fix for the issue.
Luckily, pahole 1.18 got --skip_encoding_btf_vars option disabling BTF
generation for per-CPU variables in anticipation of some unanticipated
problems. So use this escape hatch to disable per-CPU var BTF info on those
problematic pahole versions. Users relying on availability of per-CPU var BTFs
would need to upgrade to pahole 1.22+, but everyone won't notice any
regressions.
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Hao Luo <haoluo@google.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
---
scripts/link-vmlinux.sh | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
index 3b342b0b0b38..66e7053aa907 100755
--- a/scripts/link-vmlinux.sh
+++ b/scripts/link-vmlinux.sh
@@ -233,6 +233,10 @@ gen_btf()
vmlinux_link ${1}
+ if [ "${pahole_ver}" -ge "118" ] && [ "${pahole_ver}" -le "121" ]; then
+ # pahole 1.18 through 1.21 can't handle zero-sized per-CPU vars
+ extra_paholeopt="${extra_paholeopt} --skip_encoding_btf_vars"
+ fi
if [ "${pahole_ver}" -ge "121" ]; then
extra_paholeopt="${extra_paholeopt} --btf_gen_floats"
fi
--
2.30.2
next reply other threads:[~2021-05-30 0:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-30 0:25 Andrii Nakryiko [this message]
2021-05-31 9:34 ` [PATCH] kbuild: skip per-CPU BTF generation for pahole v1.18-v1.21 Mel Gorman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210530002536.3193829-1-andrii@kernel.org \
--to=andrii@kernel.org \
--cc=acme@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=bpf@vger.kernel.org \
--cc=haoluo@google.com \
--cc=hritikxx8@gmail.com \
--cc=jolsa@kernel.org \
--cc=kernel-team@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=msuchanek@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).