Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1035732iob; Fri, 13 May 2022 20:30:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvaf/vV7mrWC3LXLvCmMGK8U9++l0TjvPH68LAjVpqKe3q0kD+I44K/0cuoIKEUnMaGwNw X-Received: by 2002:a1c:f30b:0:b0:37b:b5de:c804 with SMTP id q11-20020a1cf30b000000b0037bb5dec804mr17441615wmq.166.1652499053097; Fri, 13 May 2022 20:30:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652499053; cv=none; d=google.com; s=arc-20160816; b=WWApGukElnPHFsvEHbLi4sL0HPagtEm1YQ1eCdZnUNkZx6EaC6qpA5Bc/48b6v4MYs FGLq0JLYyDeYfXy+ARw7lXPyHuroWfQ7OIG2OBJUgGFVhdUfN07rs/2fCscalSz5sc0c NKNPgNUhvsqykcnEWiLepdXrIyg1yLs28ZiQLR9vnCT+CpsHhGzjTFKDquktNINa1TEk LQygwe34qHOqa42mQE16UY8u3sISWZkBgjlf2wBR7s/iQY2tHgt7egg7+B/SFFW9K3Ou KmkzwnTezTPEgO/Y9kX2N+8tgr23zhKQeh8CTQ8q2dX3LmPI1shYnIgluGzf3WR3i/7L hSHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature:dkim-filter; bh=iQTc2AO61Uzv/pzq5Xi9leCiTwHUn5EA24N23SAXkj0=; b=Tpv0PO8w14nUmk0kFeSM8kTWXG883M60zEOOnynNWw46O3xuOsK8BJfa1cB+Q3Nl3u mKHAfwbxD5LwMgkpfWxyiqdk35c5bi7ieoj/htUG1lapJ4OfAxw2v6aBgpO//satNgMG YQZ74rqJMftw1FrOtPFS8ZlymdKDfGToV6lNa9N+lOaaG2ghw+NoQAagkIo1tcfNwCDM lWOwUbem3kyaiWlfDjqxv+vZgcY8Lfw/pU6gMpVwdYtfsoxq5vB7JFyw8+Q+5mknHelv CjpY35C0hVxSQzW/TvFJblYZZpWCCfuKG5Gcr5GW+Jsf3TdNhnEfyEoiNZkLKAlnVGnU mQcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=BnnyHMMt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id r3-20020a7bc083000000b0038ff94a4991si6728060wmh.44.2022.05.13.20.30.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 20:30:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=BnnyHMMt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CB9714273C5; Fri, 13 May 2022 17:07:28 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379951AbiEMTCv (ORCPT + 99 others); Fri, 13 May 2022 15:02:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241084AbiEMTCt (ORCPT ); Fri, 13 May 2022 15:02:49 -0400 Received: from conssluserg-01.nifty.com (conssluserg-01.nifty.com [210.131.2.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEEE17A441 for ; Fri, 13 May 2022 12:02:47 -0700 (PDT) Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) (authenticated) by conssluserg-01.nifty.com with ESMTP id 24DJ2XmT019860 for ; Sat, 14 May 2022 04:02:34 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-01.nifty.com 24DJ2XmT019860 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1652468554; bh=iQTc2AO61Uzv/pzq5Xi9leCiTwHUn5EA24N23SAXkj0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=BnnyHMMtQ4UjDy9edZIAPozQTVpIMBsqSz6xYHhRC/5iV1/iO2UneSaS9EbJHgvTj 5fQsQfS8H4dP0gaHRTSECUur7+Vr5wnaqKkLWhJyg0J6uH4KRHZZxbLJt/vQsg3/dO 4lF0mtdvzuOqeknxrk6/wVrcIvdhgrZ9GBvpcn9T2p9kYLoiJUG8ThZrtptYZGdmbX Gwkz6oDdPZS7sc5sAVox9c93LhvTSFNXPp9c+uP1miCYuhYS/xVOp5VwfxswoFFvpX w5l/U3Y3rBqx0dp9YQ4xoaOwzScjgkJKRfRGdZOcVXvp75rHULkLz5p51uuEjN+n6G agk5ZXmvZftPg== X-Nifty-SrcIP: [209.85.216.44] Received: by mail-pj1-f44.google.com with SMTP id cq17-20020a17090af99100b001dc0386cd8fso8562176pjb.5 for ; Fri, 13 May 2022 12:02:34 -0700 (PDT) X-Gm-Message-State: AOAM531pObXryvwZMXoA14qDsBUKVEZMta2aYqJr4FWjXGvSUpMG58mL JP8zx+wYRFi3NDA7iqMiv90zaMjESvshFR9IAyU= X-Received: by 2002:a17:90a:e517:b0:1d7:5bbd:f9f0 with SMTP id t23-20020a17090ae51700b001d75bbdf9f0mr6213496pjy.77.1652468553283; Fri, 13 May 2022 12:02:33 -0700 (PDT) MIME-Version: 1.0 References: <20220426155229.436681-1-mailhol.vincent@wanadoo.fr> <20220507131146.834810-1-mailhol.vincent@wanadoo.fr> <20220507131146.834810-3-mailhol.vincent@wanadoo.fr> In-Reply-To: <20220507131146.834810-3-mailhol.vincent@wanadoo.fr> From: Masahiro Yamada Date: Sat, 14 May 2022 04:01:18 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH v2 2/2] kbuild: call check-atomics.sh only if prerequisites change To: Vincent Mailhol Cc: Michal Marek , Nick Desaulniers , Linux Kernel Mailing List , Arnd Bergmann , Andy Shevchenko , Rikard Falkeborn , Andrew Morton , Kees Cook , Will Deacon , Peter Zijlstra Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 7, 2022 at 10:13 PM Vincent Mailhol wrote: > > check-atomics.sh is executed unconditionally. Most developers will not > modify the files being checked by this script and thus do not need to > execute it again for each iterative make. > > We first add an additional dependency to include/linux/atomic/* to > make sure that the script gets executed again if the headers are > modified. We then use the if_change macro instead of cmd. c.f. [1] and > create the dot file scripts/atomic/.check-atomics which is used for > the target timestamp. Finally, the dot file is added to the > CLEAN_FILES target. > > [1] https://www.kernel.org/doc/html/latest/kbuild/makefiles.html#command-change-detection > > Signed-off-by: Vincent Mailhol I do not like this approach. I wrote a different patch. https://lore.kernel.org/lkml/20220513185340.239753-1-masahiroy@kernel.org/T/#u This naturally works by comparing the timestamp between *_shipped and include/generated/*. > --- > Kbuild | 7 ++++--- > Makefile | 3 ++- > 2 files changed, 6 insertions(+), 4 deletions(-) > > diff --git a/Kbuild b/Kbuild > index fa441b98c9f6..c3cb76ebcbaf 100644 > --- a/Kbuild > +++ b/Kbuild > @@ -50,10 +50,11 @@ missing-syscalls: scripts/checksyscalls.sh $(offsets-file) FORCE > ##### > # Check atomic headers are up-to-date > > -always-y += old-atomics > +always-y += scripts/atomic/.check-atomics > > quiet_cmd_atomics = CALL $< > cmd_atomics = $(CONFIG_SHELL) $< > > -old-atomics: scripts/atomic/check-atomics.sh FORCE > - $(call cmd,atomics) > +scripts/atomic/.check-atomics: scripts/atomic/check-atomics.sh $(wildcard include/linux/atomic/*) FORCE > + $(call if_changed,atomics) > + @touch $@ > diff --git a/Makefile b/Makefile > index 9a820c525b86..9e815c8bb0b6 100644 > --- a/Makefile > +++ b/Makefile > @@ -1483,7 +1483,8 @@ endif # CONFIG_MODULES > # Directories & files removed with 'make clean' > CLEAN_FILES += include/ksym vmlinux.symvers modules-only.symvers \ > modules.builtin modules.builtin.modinfo modules.nsdeps \ > - compile_commands.json .thinlto-cache > + compile_commands.json .thinlto-cache \ > + scripts/atomic/.check-atomics > > # Directories & files removed with 'make mrproper' > MRPROPER_FILES += include/config include/generated \ > -- > 2.35.1 > -- Best Regards Masahiro Yamada