[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZOZqa8mk+4uKY87f@fjasle.eu>
Date: Wed, 23 Aug 2023 22:22:03 +0200
From: Nicolas Schier <nicolas@...sle.eu>
To: Masahiro Yamada <masahiroy@...nel.org>
Cc: linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>
Subject: Re: [PATCH 5/8] kbuild: reduce the number of mkdir calls during
modules_install
On Wed, Aug 23, 2023 at 08:50:45PM +0900 Masahiro Yamada wrote:
> Calling 'mkdir' for every module results in redundant syscalls.
>
> Use $(sort ...) to drop the duplicated directories.
>
> Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>
> ---
>
> scripts/Makefile.modinst | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst
> index 7a64ece9b826..5d687a453d90 100644
> --- a/scripts/Makefile.modinst
> +++ b/scripts/Makefile.modinst
> @@ -9,6 +9,13 @@ __modinst:
> include include/config/auto.conf
> include $(srctree)/scripts/Kbuild.include
>
> +install-y :=
> +
> +PHONY += prepare
> +
> +prepare:
> + $(Q)mkdir -p $(sort $(dir $(install-y)))
> +
> modules := $(call read-file, $(MODORDER))
>
> ifeq ($(KBUILD_EXTMOD),)
> @@ -27,6 +34,7 @@ suffix-$(CONFIG_MODULE_COMPRESS_XZ) := .xz
> suffix-$(CONFIG_MODULE_COMPRESS_ZSTD) := .zst
>
> modules := $(patsubst $(extmod_prefix)%.o, $(dst)/%.ko$(suffix-y), $(modules))
> +install-y += $(modules)
>
> __modinst: $(modules)
> @:
> @@ -35,7 +43,7 @@ __modinst: $(modules)
> # Installation
> #
> quiet_cmd_install = INSTALL $@
> - cmd_install = mkdir -p $(dir $@); cp $< $@
> + cmd_install = cp $< $@
>
> # Strip
> #
> @@ -95,6 +103,8 @@ depmod: $(modules)
> quiet_cmd_depmod = DEPMOD $(MODLIB)
> cmd_depmod = $(srctree)/scripts/depmod.sh $(KERNELRELEASE)
>
> +$(install-y): prepare
> +
> else
>
> $(dst)/%.ko: FORCE
> --
> 2.39.2
Reviewed-by: Nicolas Schier <nicolas@...sle.eu>
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists