LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] initramfs: restore default compression behaviour
@ 2020-03-11 10:22 Eugeniy Paltsev
  2020-03-11 20:12 ` Masahiro Yamada
  0 siblings, 1 reply; 4+ messages in thread
From: Eugeniy Paltsev @ 2020-03-11 10:22 UTC (permalink / raw)
  To: Masahiro Yamada, linux-kernel
  Cc: linux-snps-arc, Vineet Gupta, Alexey Brodkin, Eugeniy Paltsev

Even though INITRAMFS_SOURCE kconfig option isn't set in most of
defconfigs it is used (set) extensively by various build systems.
Commit f26661e12765 ("initramfs: make initramfs compression choice
non-optional") has changed default compression mode. Previously we
compress initramfs using available compression algorithm. Now
we don't use any compression at all by default.
It significantly increases the image size in case of build system
chooses embedded initramfs. Initially I faced with this issue while
using buildroot.

As of today it's not possible to set preferred compression mode
in target defconfig as this option depends on INITRAMFS_SOURCE
being set.
Modification of build systems doesn't look like good option in this
case as it requires to check against kernel version when setting
compression mode. The reason for this is that kconfig options
describing compression mode was renamed (in same patch series) so
we are not able to simply enable one option for old and new kernels.

Given that I propose to use GZIP as default here instead of NO
compression. It should be used only when available but given that
gzip is enabled by default it looks like good enough choice.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
---
 usr/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/usr/Kconfig b/usr/Kconfig
index bdf5bbd40727..690ef9020819 100644
--- a/usr/Kconfig
+++ b/usr/Kconfig
@@ -102,6 +102,7 @@ config RD_LZ4
 
 choice
 	prompt "Built-in initramfs compression mode"
+	default INITRAMFS_COMPRESSION_GZIP if RD_GZIP
 	depends on INITRAMFS_SOURCE != ""
 	help
 	  This option allows you to decide by which algorithm the builtin
-- 
2.21.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] initramfs: restore default compression behaviour
  2020-03-11 10:22 [PATCH] initramfs: restore default compression behaviour Eugeniy Paltsev
@ 2020-03-11 20:12 ` Masahiro Yamada
  2020-03-16 11:22   ` Eugeniy Paltsev
  0 siblings, 1 reply; 4+ messages in thread
From: Masahiro Yamada @ 2020-03-11 20:12 UTC (permalink / raw)
  To: Eugeniy Paltsev
  Cc: Linux Kernel Mailing List, arcml, Vineet Gupta, Alexey Brodkin

Hi Eugeniy.

On Wed, Mar 11, 2020 at 7:22 PM Eugeniy Paltsev
<Eugeniy.Paltsev@synopsys.com> wrote:
>
> Even though INITRAMFS_SOURCE kconfig option isn't set in most of
> defconfigs it is used (set) extensively by various build systems.
> Commit f26661e12765 ("initramfs: make initramfs compression choice
> non-optional") has changed default compression mode. Previously we
> compress initramfs using available compression algorithm. Now
> we don't use any compression at all by default.
> It significantly increases the image size in case of build system
> chooses embedded initramfs. Initially I faced with this issue while
> using buildroot.
>
> As of today it's not possible to set preferred compression mode
> in target defconfig as this option depends on INITRAMFS_SOURCE
> being set.
> Modification of build systems doesn't look like good option in this
> case as it requires to check against kernel version when setting
> compression mode. The reason for this is that kconfig options
> describing compression mode was renamed (in same patch series)

Which commit?

I do not remember the renaming of kconfig options
with this regard.



> so
> we are not able to simply enable one option for old and new kernels.
>
> Given that I propose to use GZIP as default here instead of NO
> compression. It should be used only when available but given that
> gzip is enabled by default it looks like good enough choice.



Another solution would be to move
INITRAMFS_COMPRESSION_NONE to the end of the choice menu.

The default of the choice menu is the first visible entry.

GZIP if RD_GZIP is defined, BZIP2 if RD_BZIP2 is defined ...



> Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
> ---
>  usr/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/usr/Kconfig b/usr/Kconfig
> index bdf5bbd40727..690ef9020819 100644
> --- a/usr/Kconfig
> +++ b/usr/Kconfig
> @@ -102,6 +102,7 @@ config RD_LZ4
>
>  choice
>         prompt "Built-in initramfs compression mode"
> +       default INITRAMFS_COMPRESSION_GZIP if RD_GZIP
>         depends on INITRAMFS_SOURCE != ""
>         help
>           This option allows you to decide by which algorithm the builtin
> --
> 2.21.1
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] initramfs: restore default compression behaviour
  2020-03-11 20:12 ` Masahiro Yamada
@ 2020-03-16 11:22   ` Eugeniy Paltsev
  2020-03-17  0:57     ` Masahiro Yamada
  0 siblings, 1 reply; 4+ messages in thread
From: Eugeniy Paltsev @ 2020-03-16 11:22 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Linux Kernel Mailing List, arcml, Vineet Gupta, Alexey Brodkin

Hi Masahiro,

>From: Masahiro Yamada <masahiroy@kernel.org>
>Sent: Wednesday, March 11, 2020 23:12
>To: Eugeniy Paltsev
>Cc: Linux Kernel Mailing List; arcml; Vineet Gupta; Alexey Brodkin
>Subject: Re: [PATCH] initramfs: restore default compression behaviour
>
>Hi Eugeniy.
>
>On Wed, Mar 11, 2020 at 7:22 PM Eugeniy Paltsev
><Eugeniy.Paltsev@synopsys.com> wrote:
>>
>> Even though INITRAMFS_SOURCE kconfig option isn't set in most of
>> defconfigs it is used (set) extensively by various build systems.
>> Commit f26661e12765 ("initramfs: make initramfs compression choice
>> non-optional") has changed default compression mode. Previously we
>> compress initramfs using available compression algorithm. Now
>> we don't use any compression at all by default.
>> It significantly increases the image size in case of build system
>> chooses embedded initramfs. Initially I faced with this issue while
>> using buildroot.
>>
>> As of today it's not possible to set preferred compression mode
>> in target defconfig as this option depends on INITRAMFS_SOURCE
>> being set.
>> Modification of build systems doesn't look like good option in this
>> case as it requires to check against kernel version when setting
>> compression mode. The reason for this is that kconfig options
>> describing compression mode was renamed (in same patch series)
>
>Which commit?
>
>I do not remember the renaming of kconfig options
>with this regard.

Ok, I've checked it again - looks like I was confused a bit by
"CONFIG_INITRAMFS_COMPRESSION" option
as in v5.5 kernel I have in ".config":
CONFIG_INITRAMFS_COMPRESSION=".gz"

And for v5.6-rc1 I have in ".config":
CONFIG_INITRAMFS_COMPRESSION_GZIP=y

But they are different options actually...

>
>> so
>> we are not able to simply enable one option for old and new kernels.
>>
>> Given that I propose to use GZIP as default here instead of NO
>> compression. It should be used only when available but given that
>> gzip is enabled by default it looks like good enough choice.
>
>
>Another solution would be to move
>INITRAMFS_COMPRESSION_NONE to the end of the choice menu.
>
>The default of the choice menu is the first visible entry.
>
>GZIP if RD_GZIP is defined, BZIP2 if RD_BZIP2 is defined ...

Thanks for advice. It looks like an excellent option here, I'll send a patch.

>
>> Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
>> ---
>>  usr/Kconfig | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/usr/Kconfig b/usr/Kconfig
>> index bdf5bbd40727..690ef9020819 100644
>> --- a/usr/Kconfig
>> +++ b/usr/Kconfig
>> @@ -102,6 +102,7 @@ config RD_LZ4
>>
>>  choice
>>         prompt "Built-in initramfs compression mode"
>> +       default INITRAMFS_COMPRESSION_GZIP if RD_GZIP
>>         depends on INITRAMFS_SOURCE != ""
>>         help
>>           This option allows you to decide by which algorithm the builtin
>> --
>> 2.21.1
>>
>--
>Best Regards
>Masahiro Yamada

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] initramfs: restore default compression behaviour
  2020-03-16 11:22   ` Eugeniy Paltsev
@ 2020-03-17  0:57     ` Masahiro Yamada
  0 siblings, 0 replies; 4+ messages in thread
From: Masahiro Yamada @ 2020-03-17  0:57 UTC (permalink / raw)
  To: Eugeniy Paltsev
  Cc: Linux Kernel Mailing List, arcml, Vineet Gupta, Alexey Brodkin

On Mon, Mar 16, 2020 at 8:22 PM Eugeniy Paltsev
<Eugeniy.Paltsev@synopsys.com> wrote:
>
> Hi Masahiro,
>
> >From: Masahiro Yamada <masahiroy@kernel.org>
> >Sent: Wednesday, March 11, 2020 23:12
> >To: Eugeniy Paltsev
> >Cc: Linux Kernel Mailing List; arcml; Vineet Gupta; Alexey Brodkin
> >Subject: Re: [PATCH] initramfs: restore default compression behaviour
> >
> >Hi Eugeniy.
> >
> >On Wed, Mar 11, 2020 at 7:22 PM Eugeniy Paltsev
> ><Eugeniy.Paltsev@synopsys.com> wrote:
> >>
> >> Even though INITRAMFS_SOURCE kconfig option isn't set in most of
> >> defconfigs it is used (set) extensively by various build systems.
> >> Commit f26661e12765 ("initramfs: make initramfs compression choice
> >> non-optional") has changed default compression mode. Previously we
> >> compress initramfs using available compression algorithm. Now
> >> we don't use any compression at all by default.
> >> It significantly increases the image size in case of build system
> >> chooses embedded initramfs. Initially I faced with this issue while
> >> using buildroot.
> >>
> >> As of today it's not possible to set preferred compression mode
> >> in target defconfig as this option depends on INITRAMFS_SOURCE
> >> being set.
> >> Modification of build systems doesn't look like good option in this
> >> case as it requires to check against kernel version when setting
> >> compression mode. The reason for this is that kconfig options
> >> describing compression mode was renamed (in same patch series)
> >
> >Which commit?
> >
> >I do not remember the renaming of kconfig options
> >with this regard.
>
> Ok, I've checked it again - looks like I was confused a bit by
> "CONFIG_INITRAMFS_COMPRESSION" option
> as in v5.5 kernel I have in ".config":
> CONFIG_INITRAMFS_COMPRESSION=".gz"
>
> And for v5.6-rc1 I have in ".config":
> CONFIG_INITRAMFS_COMPRESSION_GZIP=y
>
> But they are different options actually...


Right.

There is no prompt for CONFIG_INITRAMFS_COMPRESSION.
So, users have no control of it.

Because this is just a matter of the file extension,
commit 65e00e04e5aea34 moved the logic to Makefile.




-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-03-17  0:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-11 10:22 [PATCH] initramfs: restore default compression behaviour Eugeniy Paltsev
2020-03-11 20:12 ` Masahiro Yamada
2020-03-16 11:22   ` Eugeniy Paltsev
2020-03-17  0:57     ` Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).