Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1749927pxf; Fri, 2 Apr 2021 22:15:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz55d1fmn8tDdV50la1o3MhIXHSHl5axvPzbhRDJgHa79cmwrlrqNOZh0H8V07xNR44s5rb X-Received: by 2002:a17:906:6882:: with SMTP id n2mr17289640ejr.50.1617426922030; Fri, 02 Apr 2021 22:15:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617426922; cv=none; d=google.com; s=arc-20160816; b=AAKMwAxrLzi49HIALZvACDoXWMjMH4ZEc21jgsPknMq4px3iiG1iQ3z2y7ux+sQ6YW Co7SAKyrrgVQvuBwdhnjZ4QUhaLFQQHeSSHaGhs/kDJ6QUNSg3Meha6YhF4bIQVgljLv 4uw3e/1KNalPHjRZZF7vF5YfUj92Duf/xOGi5ssA4zGPVxOI464XI5Y7nDduolk2HzuK nrTirSOa+wGS3NlAL1ru2+4utwp66oFuF20NUBkb1+Z/lt+5TSaK3hvTbcln0UqXv41R ORSJOV8IOxFglIq1wlRACHrjEUtZ3fLCoDFvkXALjpXhNJwfAA1Ih9i02ItwEu9cbexu pUbw== 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=6ZV4zN2J2YGsnMVtam1aocwXNCuTiUeEo/jlCKDEurM=; b=x46KySOgbEk23QLXhLIflIY2wxsq3Exaj9anpI8scJPhRJ4rv329I7oSYBdSnfczS+ YP+yL2AQGsZ63anzbIEZ1QeQsQwVIbTqFDXji8ifqfudC4NG/oqctYGauOZ7GSxirz0x 5sHAPVKFxBNJtXaxZFDIJdWebo3ZdCIJpI2LO+LonXKwfdrR1UKwzAvN5cXEwuNZuX5i YQdZqwAkHjbb6mZisZoRNmr2M6QDwXAjlhaVpA34lwBd01PVRymUEJp+VdPlppg8uw2n 3JAnNj5TI8ubQ18iAw/9y2+leSI5+Dv6AwgEADlAmIIk1XW/zR5fprM2WkHRsrGPsGCW bK7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=y3yFoZEG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b98si1902869edf.603.2021.04.02.22.14.37; Fri, 02 Apr 2021 22:15:22 -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; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=y3yFoZEG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232200AbhDCFMG (ORCPT + 99 others); Sat, 3 Apr 2021 01:12:06 -0400 Received: from conssluserg-04.nifty.com ([210.131.2.83]:24225 "EHLO conssluserg-04.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230371AbhDCFMF (ORCPT ); Sat, 3 Apr 2021 01:12:05 -0400 Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) (authenticated) by conssluserg-04.nifty.com with ESMTP id 1335BiLj018210; Sat, 3 Apr 2021 14:11:44 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-04.nifty.com 1335BiLj018210 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1617426705; bh=6ZV4zN2J2YGsnMVtam1aocwXNCuTiUeEo/jlCKDEurM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=y3yFoZEGTt/rz3s/8n2kBohyUyPst/3jIhYq6eVpw03WaBTnRVROG7TTnS8DzmCA9 nXcCUAwtMUaUb73WoR7ix0Nj8kgC0qzjcQ+XIacpE8Gpdxzvb2uAUmZsIiYwXUjUvQ EvRlKAr/85ABJFt5bkcGtJT4/hUjRcQDIv2GcZ1emRUdpoGyuZxuaKmQRJL52G21GS VmPrc/VVUqLC5OgNgJ/CIQjLBj1d4j+CIQPQ6X+JQSbBx0Yg+iOW4+T1QaqoaCx7tw tnpDy6KXodTywH8mBX3SCTCY+c8psi4A/qf/fgd8xtD1/BEL3dsEBP3XILFshfDbSu rxZC/9ze4gikA== X-Nifty-SrcIP: [209.85.215.179] Received: by mail-pg1-f179.google.com with SMTP id f29so2253288pgm.8; Fri, 02 Apr 2021 22:11:44 -0700 (PDT) X-Gm-Message-State: AOAM530G+XwU+I4WZ1hgV0bGW7anhfo4WSTMmJflF7So4iFvLSFXc1pj /8soYUsPg5z4JGlTmWh4dIcSn1Q8tSa6LAvXUW0= X-Received: by 2002:aa7:956d:0:b029:1f1:5ba6:2a58 with SMTP id x13-20020aa7956d0000b02901f15ba62a58mr15061132pfq.63.1617426704037; Fri, 02 Apr 2021 22:11:44 -0700 (PDT) MIME-Version: 1.0 References: <1617317072-26770-1-git-send-email-eberman@codeaurora.org> In-Reply-To: <1617317072-26770-1-git-send-email-eberman@codeaurora.org> From: Masahiro Yamada Date: Sat, 3 Apr 2021 14:11:07 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] Kbuild: Update config_data.gz only if KCONFIG_CONFIG materially changed To: Elliot Berman Cc: Michal Marek , Linux Kbuild mailing list , Linux Kernel Mailing List , Matthias Maennich , Trilok Soni Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 2, 2021 at 7:45 AM Elliot Berman wrote: > > If you update the timestamp of KCONFIG_CONFIG without actually changing > anything, config_data.gz is re-generated and causes vmlinux to re-link. > When Link Time Optimization is enabled, unnecessary re-linking of > vmlinux is highly desirable since it adds several minutes to build time. > > Avoid touching config_data.gz by using filechk to compare the existing > config_data.gz and update only if it changed. > > The .config can be touched, for instance, by a build script which > installs the default defconfig and then applies a defconfig fragment on > top. > > For a simple example on my x86 machine, I modified x86 default defconfig to set > CONFIG_IKCONFIG=y and run: > make -j50 defconfig tiny.config vmlinux > make -j50 defconfig tiny.config vmlinux > With this patch, vmlinux is not re-built as a result of config_data.gz > change. > > Signed-off-by: Elliot Berman > --- > kernel/Makefile | 2 +- > scripts/Makefile.lib | 2 ++ > 2 files changed, 3 insertions(+), 1 deletion(-) > > diff --git a/kernel/Makefile b/kernel/Makefile > index 320f1f3..bd4e558 100644 > --- a/kernel/Makefile > +++ b/kernel/Makefile > @@ -140,7 +140,7 @@ $(obj)/configs.o: $(obj)/config_data.gz > > targets += config_data.gz > $(obj)/config_data.gz: $(KCONFIG_CONFIG) FORCE > - $(call if_changed,gzip) > + $(call filechk,gzip) I do not think this is the right approach because gzip is executed every time, even if the time stamp is not changed. > > $(obj)/kheaders.o: $(obj)/kheaders_data.tar.xz > > diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib > index a4fbaf8..81d3ec1 100644 > --- a/scripts/Makefile.lib > +++ b/scripts/Makefile.lib > @@ -282,6 +282,8 @@ cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@ > quiet_cmd_gzip = GZIP $@ > cmd_gzip = cat $(real-prereqs) | $(KGZIP) -n -f -9 > $@ > > +filechk_gzip = cat $(real-prereqs) | $(KGZIP) -n -f -9 > + > # DTC > # --------------------------------------------------------------------------- > DTC ?= $(objtree)/scripts/dtc/dtc > -- > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, > a Linux Foundation Collaborative Project > -- Best Regards Masahiro Yamada