[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNAQ809M8VKAOBfqSn_Sc8iPgTMVu5icOgnddH_YKDvOpzA@mail.gmail.com>
Date: Fri, 31 Jan 2025 23:26:19 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: Nathan Chancellor <nathan@...nel.org>
Cc: Charlie Jenkins <charlie@...osinc.com>, Nicolas Schier <nicolas@...sle.eu>,
Paul Walmsley <paul.walmsley@...ive.com>, Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>, linux-kbuild@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-riscv@...ts.infradead.org
Subject: Re: [PATCH] kbuild: Use --strip-unneeded with INSTALL_MOD_STRIP
On Fri, Jan 31, 2025 at 12:52 PM Nathan Chancellor <nathan@...nel.org> wrote:
>
> On Wed, Jan 22, 2025 at 07:17:26PM -0800, Charlie Jenkins wrote:
> > On riscv, kernel modules end up with a significant number of local
> > symbols. This becomes apparent when compiling modules with debug symbols
> > enabled. Using amdgpu.ko as an example of a large module, on riscv the
> > size is 754MB (no stripping), 53MB (--strip-debug), and 21MB
> > (--strip-unneeded). ON x86, amdgpu.ko is 482MB (no stripping), 21MB
> > (--strip-debug), and 20MB (--strip-unneeded).
> >
> > Use --strip-unneeded instead of --strip-debug to strip modules so
> > decrease the size of the resulting modules. This is particularly
> > relevant for riscv, but also marginally aids other architectures.
> >
> > Signed-off-by: Charlie Jenkins <charlie@...osinc.com>
>
> Is there any sort of regression risk with this patch? If so, another
> option may be to give another level to INSTALL_MOD_STRIP like 2 so that
> INSTALL_MOD_STRIP=1 continues to behave as before but people can easily
> opt into this option. No strong opinion because I am not sure but was
> not sure if it was considered.
I do not think INSTALL_MOD_STRIP=2 is worth supporting because
it is equivalent to INSTALL_MOD_STRIP=--strip-unneeded
Documentation/kbuild/kbuild.rst explains that
any value other than '1' is passed to the strip command.
INSTALL_MOD_STRIP
-----------------
INSTALL_MOD_STRIP, if defined, will cause modules to be
stripped after they are installed. If INSTALL_MOD_STRIP is '1', then
the default option --strip-debug will be used. Otherwise,
INSTALL_MOD_STRIP value will be used as the options to the strip command.
RISCV users can pass INSTALL_MOD_STRIP=--strip-unneeded.
So, the question is, is it better to change the default option
of INSTALL_MOD_STRIP=1 ?
>
> Regardless:
>
> Reviewed-by: Nathan Chancellor <nathan@...nel.org>
>
> > ---
> > scripts/Makefile.modinst | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst
> > index f97c9926ed31b2b14601ff7773a2ea48b225628b..c22f35f6b9db3cac3923b9e787b219f752570642 100644
> > --- a/scripts/Makefile.modinst
> > +++ b/scripts/Makefile.modinst
> > @@ -80,7 +80,7 @@ quiet_cmd_install = INSTALL $@
> > ifdef INSTALL_MOD_STRIP
> >
> > ifeq ($(INSTALL_MOD_STRIP),1)
> > -strip-option := --strip-debug
> > +strip-option := --strip-unneeded
> > else
> > strip-option := $(INSTALL_MOD_STRIP)
> > endif
> >
> > ---
> > base-commit: ffd294d346d185b70e28b1a28abe367bbfe53c04
> > change-id: 20250122-strip_unneeded-cab729310056
> > --
> > - Charlie
> >
--
Best Regards
Masahiro Yamada
Powered by blists - more mailing lists