Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp213772pxj; Fri, 28 May 2021 02:06:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJythZcVqzGnfDHpC6zsZb0yO4hs3TDixPbDE/nOvam3gwMHoHKxtBzJk5ISO2rfxlI+3VQN X-Received: by 2002:a17:906:c7d2:: with SMTP id dc18mr8310497ejb.188.1622192805386; Fri, 28 May 2021 02:06:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622192805; cv=none; d=google.com; s=arc-20160816; b=Pcbq6/i+qGaIFUdXSjpvefb/BMxeUB7kbufK6XUjP2lTjI+DT0AgI16+XIHBBfF7W+ MOCXNLgzUA/pSRyE1kzlGfcQSXTR/X8wtuQpPmpFfRl1JogusD+pAPmFwl4jaMgunaVO Xid7TAxItAXOu/exqRxausH8QfWunQpMQKxfT2Ss5JDHgvtgN/s9JJwIsaKwrUpHOfEt wPE4yabH1pn4ljjysHZK23dMcV8zyTDtCq+zKWGhjsK5pQ5JH/xMV9dQbWRMf4Q8UG2F YUzCa76+UKTDLh4a8mtnbUhoMjmtyRmPSOcrfLigkATnSw1dYCuQH3Gz+A4uzKz80/Rl MU2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=4cJzLzpYg4NK6rhR+NmusmWfJUtk7VKMxfof+ySgpvU=; b=m/YpjHXH92wK9vsWKJ2yEv7oRPoCVd5VrVwpMjv38sjd1SO+p3ah4s9SPwQyQ9rukf 4v9tceXOxipP4n1qsqHPtwh4+9T6KywJRpIAe1nDXP54xteWd/yo7vMo3zXYgHPCoiD5 6UOsxgy+qTu92UXNZq842t7OgCVDsDvwg2Kxn5jimVX9QpYVJkAcl9Ja2NduiWJivbfZ y/rJwkfEzxZGGOoDuv0g2E9aE6dFN4qVjwuRDqW9UO7jIYnnGtOeZeZAsctRr5XbHKuj NwPz7tGK+agzUtzSde306Um5gHdENSoEpPbg7GMi7OAUbhZrJbX1QU2CAVA70Fs2Vmhe duAQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w24si4214692edv.320.2021.05.28.02.06.22; Fri, 28 May 2021 02:06:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232012AbhE1HpL (ORCPT + 99 others); Fri, 28 May 2021 03:45:11 -0400 Received: from outbound-smtp21.blacknight.com ([81.17.249.41]:54989 "EHLO outbound-smtp21.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230133AbhE1HpI (ORCPT ); Fri, 28 May 2021 03:45:08 -0400 Received: from mail.blacknight.com (pemlinmail06.blacknight.ie [81.17.255.152]) by outbound-smtp21.blacknight.com (Postfix) with ESMTPS id 3B693CCA5F for ; Fri, 28 May 2021 08:42:50 +0100 (IST) Received: (qmail 25301 invoked from network); 28 May 2021 07:42:49 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.23.168]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 28 May 2021 07:42:49 -0000 Date: Fri, 28 May 2021 08:42:48 +0100 From: Mel Gorman To: Andrii Nakryiko Cc: Andrew Morton , Christoph Hellwig , Arnaldo Carvalho de Melo , Michal Suchanek , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , LKML , Jiri Olsa , Hritik Vijay , Linux-BPF , Linux-Net , Linux-MM , clm@fb.com Subject: Re: [PATCH v3] mm/page_alloc: Require pahole v1.22 to cope with zero-sized struct pagesets Message-ID: <20210528074248.GI30378@techsingularity.net> References: <20210527171923.GG30378@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 27, 2021 at 03:17:48PM -0700, Andrii Nakryiko wrote: > > Andrii Nakryiko bisected the problem to the commit "mm/page_alloc: convert > > per-cpu list protection to local_lock" currently staged in mmotm. In his > > own words > > > > The immediate problem is two different definitions of numa_node per-cpu > > variable. They both are at the same offset within .data..percpu ELF > > section, they both have the same name, but one of them is marked as > > static and another as global. And one is int variable, while another > > is struct pagesets. I'll look some more tomorrow, but adding Jiri and > > Arnaldo for visibility. > > > > [110907] DATASEC '.data..percpu' size=178904 vlen=303 > > ... > > type_id=27753 offset=163976 size=4 (VAR 'numa_node') > > type_id=27754 offset=163976 size=4 (VAR 'numa_node') > > > > [27753] VAR 'numa_node' type_id=27556, linkage=static > > [27754] VAR 'numa_node' type_id=20, linkage=global > > > > [20] INT 'int' size=4 bits_offset=0 nr_bits=32 encoding=SIGNED > > > > [27556] STRUCT 'pagesets' size=0 vlen=1 > > 'lock' type_id=507 bits_offset=0 > > > > [506] STRUCT '(anon)' size=0 vlen=0 > > [507] TYPEDEF 'local_lock_t' type_id=506 > > > > The patch in question introduces a zero-sized per-cpu struct and while > > this is not wrong, versions of pahole prior to 1.22 get confused during > > BTF generation with two separate variables occupying the same address. > > > > This patch adds a requirement for pahole 1.22 before setting > > DEBUG_INFO_BTF. While pahole 1.22 does not exist yet, a fix is in the > > pahole git tree as ("btf_encoder: fix and complete filtering out zero-sized > > per-CPU variables"). > > > > Reported-by: Michal Suchanek > > Reported-by: Hritik Vijay > > Debugged-by: Andrii Nakryiko > > Signed-off-by: Mel Gorman > > --- > > I still think that v1 ([0]) is a more appropriate temporary solution > until pahole 1.22 is released and widely packaged. Suddenly raising > the minimum version to 1.22, which is not even released even, is a > pretty big compatibility concern for all the users that rely on > CONFIG_DEBUG_INFO_BTF. On the flip side, we have a situation where a build tool (pahole) has a problem whereby correct code does not result in a working kernel. It's not that dissimilar to preventing the kernel being built on an old compiler. While I accept it's unfortunate, Christoph had a point where introducing workarounds in the kernel could lead to a prolification of workarounds for pahole or other reasons that are potentially tricky to revert as long as distributions exist that do not ship with a sufficiently reason package. > Just a few days ago pahole 1.16 worked fine and > here we suddenly (and silently due to how Kconfig functions) raise > that to a version that doesn't exist. That's going to break workflows > for a lot of people. > People do have a workaround though. For the system building the kernel, they can patch pahole and revert the check so a bootable kernel can be built. It's not convenient but it is manageable and pahole has until 5.13 releases to release a v1.22. The downsides for the alternative -- a non-booting kernel are much more severe. > I'm asking to have that ugly work-around to ensure sizeof(struct > pagesets) > 0 as a temporary solution only. Another temporary solution is to locally build pahole and either revert the check or fake the 1.22 release number with the self-built pahole. -- Mel Gorman SUSE Labs