Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3122250rdg; Tue, 17 Oct 2023 05:31:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHdzZlhmigMYNoaB098fqFHxG6OUozTO0vKT1N0C3tSjRm/+h0LJFHwIG+6gg7uo0Cdzs/S X-Received: by 2002:a05:6a00:2389:b0:68b:eb3d:8030 with SMTP id f9-20020a056a00238900b0068beb3d8030mr2299127pfc.1.1697545870491; Tue, 17 Oct 2023 05:31:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697545870; cv=none; d=google.com; s=arc-20160816; b=RdjdgbQSuGjc12yW9OJawf1bFOpC+zHYF+CnfibkiqTpCEkAvrs1ZIYQEt1yMlLv5i VvUbLbwHFf8ohyUiUqvxLWdcJOIr1KpaQpNLrqqkPt6pd/rJy7ThNe2Ex7fpIMIkvKJ3 gfprdmEgxGWehhyMPxpR6+CbPRvrbyofz0uoSmuYwxUxbJSISBgTzxQMnIq+iqcXnj3J 9ygyLOtHZ/bTyhgm0GMjSRqSos57moJ7kQIzZVs2IxSIch5XCZujpuRRFtz5w28z8Z4t nA+/bun9QDly+jCvHe044crUBvIP4N0n04V6DpGqJO8QzKoFL4cLGG0QZpxhhWKhhRPf WaCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=6mEoTkzHNoLB015l60C+iFhIjcScO3DbA0DZNDtD/fI=; fh=AM6iSLjfRcP3o+NTbCic+QZUiiwv9QOiP6qgjqK2bQY=; b=PHG/1lRAqWtWXzFKXtMhtDQtamTQIGZ1edFA734Od7FJAHEKuNFMr8lQAHCgRLqbnR RSinpB4jGX5gCtzeMGybKO3LzsA7S8jr5D42TwHSdx+CWA56lT17e4NrH248YLsBw/mi ryKB8+mIpQWb1QaCPg4uAInblz0syicMMq7TEDpQjUluvetQKA9AHm5MdKEWDJIycjzN ApV22fICFL/Z0CsWTXUSUcW+uko2TgEgegsTUnhTjahB6ydGcsPDGA0rzgLh+xCfQK5f FKZa2gH9uDJCHS52FPnrlBDKJ5WqMiHz7OtbYiwFskCCCPlUCYOX9/5UsEPRGcZZHPMa 0oSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@avm.de header.s=mail header.b=DLTrj+tO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=avm.de Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id q13-20020a056a00084d00b006bd9c159a98si1581726pfk.186.2023.10.17.05.31.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 05:31:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@avm.de header.s=mail header.b=DLTrj+tO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=avm.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id E16F580689DB; Tue, 17 Oct 2023 05:30:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343678AbjJQMao (ORCPT + 99 others); Tue, 17 Oct 2023 08:30:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235344AbjJQMa2 (ORCPT ); Tue, 17 Oct 2023 08:30:28 -0400 Received: from mail.avm.de (mail.avm.de [IPv6:2001:bf0:244:244::119]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BED9F9; Tue, 17 Oct 2023 05:29:59 -0700 (PDT) Received: from mail-auth.avm.de (dovecot-mx-01.avm.de [212.42.244.71]) by mail.avm.de (Postfix) with ESMTPS; Tue, 17 Oct 2023 14:29:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=avm.de; s=mail; t=1697545797; bh=zLahxL+QXI3rfdx1iiel7NusxwDfyi7i9OT70ttG0sI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DLTrj+tOPB+cWfqo3Be1jRRCeHJzMzOdcWFEiMSPuJTH7boM/qyMZ+F31owpydLTi /dRJjk+1yCfUM9I46b96H/x9MmxF7O7mDQFUcKv6QvqT2d+0e2Qnca4cq+FVb/pu4T K4z+p/lIETLJdQmp5ev7O8R0hWHNAnt+uxQ05Tc4= Received: from buildd.core.avm.de (buildd-sv-01.avm.de [172.16.0.225]) by mail-auth.avm.de (Postfix) with ESMTPA id 8F52280C3A; Tue, 17 Oct 2023 14:29:57 +0200 (CEST) Received: by buildd.core.avm.de (Postfix, from userid 1000) id 7A521180CD9; Tue, 17 Oct 2023 14:29:57 +0200 (CEST) Date: Tue, 17 Oct 2023 14:29:57 +0200 From: Nicolas Schier To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Alex Gaynor , Alexei Starovoitov , Alice Ryhl , Andreas Hindborg , Andrii Nakryiko , Benno Lossin , =?utf-8?B?QmrDtnJu?= Roy Baron , Boqun Feng , Daniel Borkmann , Gary Guo , Hao Luo , Jiri Olsa , John Fastabend , KP Singh , Martin KaFai Lau , Miguel Ojeda , Nathan Chancellor , Nick Desaulniers , Nicolas Schier , Song Liu , Stanislav Fomichev , Wedson Almeida Filho , Yonghong Song , bpf@vger.kernel.org, rust-for-linux@vger.kernel.org Subject: Re: [PATCH 2/4] kbuild: avoid too many execution of scripts/pahole-flags.sh Message-ID: Mail-Followup-To: Masahiro Yamada , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Alex Gaynor , Alexei Starovoitov , Alice Ryhl , Andreas Hindborg , Andrii Nakryiko , Benno Lossin , =?utf-8?B?QmrDtnJu?= Roy Baron , Boqun Feng , Daniel Borkmann , Gary Guo , Hao Luo , Jiri Olsa , John Fastabend , KP Singh , Martin KaFai Lau , Miguel Ojeda , Nathan Chancellor , Nick Desaulniers , Song Liu , Stanislav Fomichev , Wedson Almeida Filho , Yonghong Song , bpf@vger.kernel.org, rust-for-linux@vger.kernel.org References: <20231017103742.130927-1-masahiroy@kernel.org> <20231017103742.130927-2-masahiroy@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20231017103742.130927-2-masahiroy@kernel.org> X-purgate-ID: 149429::1697545797-CBE3C0EE-94F75A2F/0/0 X-purgate-type: clean X-purgate-size: 1635 X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate: clean X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 17 Oct 2023 05:30:56 -0700 (PDT) > Subject: kbuild: avoid too many execution of scripts/pahole-flags.sh executions? On Tue, Oct 17, 2023 at 07:37:40PM +0900, Masahiro Yamada wrote: > scripts/pahole-flags.sh is executed so many times. > > You can check how many times it is invoked during the build, as follows: > > $ cat <> scripts/pahole-flags.sh > > echo "scripts/pahole-flags.sh was executed" >&2 > > EOF > > $ make -s > scripts/pahole-flags.sh was executed > scripts/pahole-flags.sh was executed > scripts/pahole-flags.sh was executed > scripts/pahole-flags.sh was executed > scripts/pahole-flags.sh was executed > [ lots of repeated lines suppressed... ] > > This scripts is exectuted more than 20 times during the kernel build executed > because PAHOLE_FLAGS is a recursively expanded variable and exported > to sub-processes. > > With the GNU Make >= 4.4, it is executed more than 60 times because > exported variables are also passed to other $(shell ) invocations. > Without careful coding, it is known to cause an exponential fork > explosion. [1] > > The use of $(shell ) in an exported recursive variable is likely wrong > because $(shell ) is always evaluated due to the 'export' keyword, and > the evaluation can occur multiple times by the nature of recursive > variables. > > Convert the shell script to a Makefile, which is included only when > CONFIG_DEBUG_INFO_BTF=y. > > [1]: https://savannah.gnu.org/bugs/index.php?64746 > > Signed-off-by: Masahiro Yamada > --- Thanks, looks good to me! Reviewed-by: Nicolas Schier