From patchwork Sun May 30 00:25:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrii Nakryiko X-Patchwork-Id: 12288041 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28485C47082 for ; Sun, 30 May 2021 00:30:07 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9932A610FA for ; Sun, 30 May 2021 00:30:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9932A610FA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id A79426B006C; Sat, 29 May 2021 20:30:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A04316B006E; Sat, 29 May 2021 20:30:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8C9186B0070; Sat, 29 May 2021 20:30:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0139.hostedemail.com [216.40.44.139]) by kanga.kvack.org (Postfix) with ESMTP id 506956B006C for ; Sat, 29 May 2021 20:30:05 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id BE0168249980 for ; Sun, 30 May 2021 00:30:04 +0000 (UTC) X-FDA: 78196015128.30.4CB019A Received: from mx0a-00082601.pphosted.com (mx0a-00082601.pphosted.com [67.231.145.42]) by imf11.hostedemail.com (Postfix) with ESMTP id C86AD200105D for ; Sun, 30 May 2021 00:29:51 +0000 (UTC) Received: from pps.filterd (m0109334.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 14U0U2ue009099 for ; Sat, 29 May 2021 17:30:02 -0700 Received: from mail.thefacebook.com ([163.114.132.120]) by mx0a-00082601.pphosted.com with ESMTP id 38umx7t4ju-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sat, 29 May 2021 17:30:02 -0700 Received: from intmgw001.05.ash7.facebook.com (2620:10d:c085:208::f) by mail.thefacebook.com (2620:10d:c085:11d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Sat, 29 May 2021 17:30:02 -0700 Received: by devbig012.ftw2.facebook.com (Postfix, from userid 137359) id 6801D2EDD016; Sat, 29 May 2021 17:25:51 -0700 (PDT) From: Andrii Nakryiko To: CC: , , , , , , , , Andrii Nakryiko , Arnaldo Carvalho de Melo , Hao Luo Subject: [PATCH] kbuild: skip per-CPU BTF generation for pahole v1.18-v1.21 Date: Sat, 29 May 2021 17:25:36 -0700 Message-ID: <20210530002536.3193829-1-andrii@kernel.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-FB-Internal: Safe X-Proofpoint-ORIG-GUID: HUizu3EFZO3whmsuMdU1bwKMFvk5vbJq X-Proofpoint-GUID: HUizu3EFZO3whmsuMdU1bwKMFvk5vbJq X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.761 definitions=2021-05-29_11:2021-05-27,2021-05-29 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 clxscore=1011 priorityscore=1501 bulkscore=0 malwarescore=0 phishscore=0 mlxlogscore=804 mlxscore=0 impostorscore=0 spamscore=0 lowpriorityscore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2105300001 X-FB-Internal: deliver Authentication-Results: imf11.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=kernel.org (policy=none); spf=pass (imf11.hostedemail.com: domain of "prvs=5784fe2c2d=andriin@fb.com" designates 67.231.145.42 as permitted sender) smtp.mailfrom="prvs=5784fe2c2d=andriin@fb.com" X-Stat-Signature: uquott3gcdik7o38qs7r461fpgorinqs X-Rspamd-Queue-Id: C86AD200105D X-Rspamd-Server: rspam02 X-HE-Tag: 1622334591-543766 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 Cc: Arnaldo Carvalho de Melo Cc: Hao Luo Signed-off-by: Andrii Nakryiko Acked-by: Mel Gorman --- 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