From mboxrd@z Thu Jan 1 00:00:00 1970 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=-2.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no 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 CE509C4707F for ; Thu, 27 May 2021 22:25:25 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 63393611C2 for ; Thu, 27 May 2021 22:25:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 63393611C2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4107A6B006C; Thu, 27 May 2021 18:25:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3A5AD6B006E; Thu, 27 May 2021 18:25:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DF0CE6B0070; Thu, 27 May 2021 18:25:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0236.hostedemail.com [216.40.44.236]) by kanga.kvack.org (Postfix) with ESMTP id 96EF96B006C for ; Thu, 27 May 2021 18:25:23 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 2A39E1803A178 for ; Thu, 27 May 2021 22:25:23 +0000 (UTC) X-FDA: 78188443326.20.5FB849B Received: from mail-yb1-f173.google.com (mail-yb1-f173.google.com [209.85.219.173]) by imf15.hostedemail.com (Postfix) with ESMTP id 02D2BA0001FF for ; Thu, 27 May 2021 22:25:17 +0000 (UTC) Received: by mail-yb1-f173.google.com with SMTP id o18so2833312ybc.8 for ; Thu, 27 May 2021 15:25:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7uOtvAQxo11BZ9qV4iscB9IwPVfNGrEjy6zxUfl9fAQ=; b=M7JkcsTVF7/siykqcbEhtevruKBCIx0gc9z1xs99OMOplvieDhCOZuwzx0RpQZTYIq UdXGrfOLSslfU37BlHTfJeyq8vgNte94vccbZMEenubMID/jVp3kpFORE+K0rG7pqLXM j15VIecE4NbOv5xDy39wDbM9a5uoqMa0KMwx2ZOA1n5C5KWBp62jWBGnuj5u3HxnHVvm ROrskkYmFIU+kZ4W1a5fSzSitr4+5XDhq/mJAS8WZUsUIAil9OBjAiAbBnKAZX9+8Hlc PrvJAjfCJQ8gG5LHi5V84ME3YToHskuuGR+6JI2aDxQuiFT3qjO40XsCfQUDBhZFUJru wqjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7uOtvAQxo11BZ9qV4iscB9IwPVfNGrEjy6zxUfl9fAQ=; b=rLGwGeogFiv74zTS9gD8UvOtYMaA70NeSruar3a/5VLo4C6gUI3GGjmfkbUHir5c75 ttDKE1pdXeL81sYCf4vs36/Ib+JriPZLxXlIXInwb3mXor67kHqRQByDnkhfQT3DAYew s4Il/kzFNWgAw891vkbk5iShJDPP7PCOQiCF7iNuZKFGVMLvvI1HrhFeLvZuxey7Ev4N oitlfvOH9RF+yp0BTg8OTC6Z05hDUZ/NPiejzHDKj2ihI/qKq/jI+wbOpEEpKhUdLBmT r+JFEzWs2ZkvTD5cA3a4q7kE54zo2xg3o/saJG6IVusuJ0drG4UHLYNJklQ2hLHwSkcH TwBQ== X-Gm-Message-State: AOAM53008IMqgBOSebaXo/wMo7ih6eBUYQf9n/qUNBj5fl3kaVicTniX S3LWXkaCuOnJt3lkZkmTtcmka+ycntyIP5o9yDc= X-Google-Smtp-Source: ABdhPJwep05E6OXImfZO1Z6zxyIrNIa/XIFP2ZNM+bMfL7sTFz8oYlsBRkxELywH69UbX1Cwi9Y0EKKE4bunYVTo2lA= X-Received: by 2002:a25:3357:: with SMTP id z84mr7803181ybz.260.1622154322177; Thu, 27 May 2021 15:25:22 -0700 (PDT) MIME-Version: 1.0 References: <20210527120251.GC30378@techsingularity.net> <20210527145441.GE30378@techsingularity.net> <20210527172700.GH30378@techsingularity.net> In-Reply-To: <20210527172700.GH30378@techsingularity.net> From: Andrii Nakryiko Date: Thu, 27 May 2021 15:25:10 -0700 Message-ID: Subject: Re: [PATCH v2] mm/page_alloc: Work around a pahole limitation with zero-sized struct pagesets To: Mel Gorman , Masahiro Yamada 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 Content-Type: text/plain; charset="UTF-8" Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=M7JkcsTV; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf15.hostedemail.com: domain of andriinakryiko@gmail.com designates 209.85.219.173 as permitted sender) smtp.mailfrom=andriinakryiko@gmail.com X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 02D2BA0001FF X-Stat-Signature: a1iz3y35w1c4ffctahwztyzruxe8xwa1 X-HE-Tag: 1622154317-158602 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: On Thu, May 27, 2021 at 10:27 AM Mel Gorman wrote: > > On Thu, May 27, 2021 at 09:36:35AM -0700, Andrii Nakryiko wrote: > > On Thu, May 27, 2021 at 7:54 AM Mel Gorman wrote: > > > > > > On Thu, May 27, 2021 at 07:37:05AM -0700, Andrii Nakryiko wrote: > > > > > This patch checks for older versions of pahole and only allows > > > > > DEBUG_INFO_BTF_MODULES if pahole supports zero-sized per-cpu structures. > > > > > DEBUG_INFO_BTF is still allowed as a KVM boot test passed with pahole > > > > > > > > Unfortunately this won't work. The problem is that vmlinux BTF is > > > > corrupted, which results in module BTFs to be rejected as well, as > > > > they depend on it. > > > > > > > > But vmlinux BTF corruption makes BPF subsystem completely unusable. So > > > > even though kernel boots, nothing BPF-related works. So we'd need to > > > > add dependency for DEBUG_INFO_BTF on pahole 1.22+. > > > > > > > > > > While bpf usage would be broken, the kernel will boot and the effect > > > should be transparent to any kernel build based on "make oldconfig". > > > > I think if DEBUG_INFO_BTF=y has no chance of generating valid vmlinux > > BTF it has to be forced out. So if we are doing this at all, we should > > do it for CONFIG_DEBUG_INFO_BTF, not CONFIG_DEBUG_INFO_BTF_MODULES. > > CONFIG_DEBUG_INFO_BTF_MODULES will follow automatically. > > > > Ok, I sent a version that prevents DEBUG_INFO_BTF being set unless > pahole is at least 1.22. > > > > CONFIG_DEBUG_INFO_BTF defaults N so if that is forced out, it will be > > > easily missed by a distribution kernel maintainer. > > > > We actually had previous discussions on forcing build failure in cases > > when CONFIG_DEBUG_INFO_BTF=y can't be satisfied, but no one followed > > up. > > It is weird how it is handled. DEBUG_INFO_BTF can be set and then fail to > build vmlinux because pahole is too old. With DEBUG_INFO_BTF now requiring > at least 1.22, the other version checks for 1.16 and 1.19 are redundant > and could be cleaned up. > > > I'll look into this and will try to change the behavior. It's > > caused too much confusion previously and now with changes like this we > > are going to waste even more people's time. > > > > Thanks. So I've tried to change that, but I'm not sure that's possible with the current Kconfig system. I tried to use $(error-if), but it happens too early, at the text pre-processing stage, before the value of CONFIG_DEBUG_INFO_BTF is known, so it's impossible to express something like this: $(error_if,CONFIG_DEBUG_INFO_BTF=y && PAHOLE_VERSION < 116,Pahole is tool old) Masahiro, is it possible to somehow express the condition that if CONFIG_DEBUG_INFO_BTF=y is selected, but some external dependency (pahole version in this case) is too old, then fail the build immediately? Currently we fail at the very end of vmlinux linking step, which is very late. Alternatively, it was proposed to just add an extra dependency (like, "depends PAHOLE_IS_116_OR_NEWER"), but that will silently unselect CONFIG_DEBUG_INFO_BTF if the condition is not satisfied, so it's even more confusing to users. Any suggestions on how to proceed with something like that? Thanks! > > -- > Mel Gorman > SUSE Labs