Re: [for-next][PATCH 04/26] bootconfig: Add Extra Boot Config support
From: Geert Uytterhoeven
Date: Fri Feb 07 2020 - 03:49:16 EST
Hi Hiramatsu-san,
On Fri, Feb 7, 2020 at 1:30 AM Masami Hiramatsu <mhiramat@xxxxxxxxxx> wrote:
> On Thu, 6 Feb 2020 18:20:15 +0100
> Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> wrote:
> > On Thu, Feb 6, 2020 at 3:42 PM Masami Hiramatsu <mhiramat@xxxxxxxxxx> wrote:
> > > On Thu, 6 Feb 2020 12:54:05 +0100
> > > Borislav Petkov <bp@xxxxxxxxx> wrote:
> > > > On Tue, Jan 14, 2020 at 04:03:20PM -0500, Steven Rostedt wrote:
> > > > > diff --git a/init/Kconfig b/init/Kconfig
> > > > > index a34064a031a5..63450d3bbf12 100644
> > > > > --- a/init/Kconfig
> > > > > +++ b/init/Kconfig
> > > > > @@ -1215,6 +1215,17 @@ source "usr/Kconfig"
> > > > >
> > > > > endif
> > > > >
> > > > > +config BOOT_CONFIG
> > > > > + bool "Boot config support"
> > > > > + select LIBXBC
> > > > > + default y
> > > >
> > > > Any particular reason this is default y? Why should it be enabled by
> > > > default on all boxes?
> > >
> > > Oh, you are not the first person asked that :)
> > >
> > > https://lkml.org/lkml/2019/12/9/563
> > >
> > > And yes, I think this is important that will useful for most developers
> > > and admins. Since the bootconfig already covers kernel and init options,
> > > this can be a new standard way to pass args to kernel boot.
> > >
> > > And as I reported above thread, the memory footpoint of view, most code
> > > and working memory are released after boot. Also, as Linus's suggested,
> > > now this feature is enabled only if user gives "bootconfig" on the kernel
> > > command line. So the side effect is minimized.
> >
> > With m68k/atari_defconfig, bloat-o-meter says:
> >
> > add/remove: 39/0 grow/shrink: 2/0 up/down: 13086/0 (13086)
> >
> > which is IMHO not that small for a "default y" option that may or may not
> > be used.
> >
> > Especially:
> >
> > Function old new delta
> > xbc_nodes - 8192 +8192
> >
> > Any chance xbc_nodes can be allocated dynamically, and only when needed?
>
> Yes, I think we can use memblock to allocate it. However, this xbc_nodes is
Good.
> __init_data, which is released right after boot. So I think it should be
> OK except for your system doesn't have user space...
__initdata is still part of the kernel image (note that we no longer
have __initbss) and consumes RAM early on, and is thus subject to e.g.
bootloader[1] and platform limitations (e.g. the kernel must fit in the
first block of physical memory).
So trying to avoid large static arrays is useful.
> > Yes, there are industrial products running Linux on a current ARM SoC
> > using the builtin 8 or 10 MiB of SRAM (+ XIP for the kernel), so these
> > definitely want to say CONFIG_BOOT_CONFIG=n.
>
> I think for such products the kernel must be tuned with custom config,
> and you can say CONFIG_BOOT_CONFIG=n. That is a configurable feature.
I do not dispute that.
[1] Re: [PATCH] dma-debug: dynamic allocation of hash table
https://lore.kernel.org/lkml/CAMuHMdVSyD62nvRmN-v6CbJ2UyqH=d7xdVeCD8_X5us+mvCXUQ@xxxxxxxxxxxxxx/
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds