From: Ingo Molnar <mingo@kernel.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linux-kernel@vger.kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Peter Zijlstra <peterz@infradead.org>,
Borislav Petkov <bp@alien8.de>,
Thomas Gleixner <tglx@linutronix.de>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Ard Biesheuvel <ardb@kernel.org>,
David Woodhouse <dwmw@amazon.co.uk>,
Masahiro Yamada <yamada.masahiro@socionext.com>,
Michal Marek <michal.lkml@markovi.net>
Subject: Re: [PATCH 13/15] x86/kconfig/64: Enable popular scheduler, cgroups and namespaces options in the defconfig
Date: Wed, 7 May 2025 18:09:37 +0200 [thread overview]
Message-ID: <aBuFwQqQd3wldnHm@gmail.com> (raw)
In-Reply-To: <e1585615-e8bb-47bf-846c-b0d2696d0c1f@app.fastmail.com>
* Arnd Bergmann <arnd@arndb.de> wrote:
> > +CONFIG_SYSFS_SYSCALL=y
> > +CONFIG_EXPERT=y
> > CONFIG_KALLSYMS_ALL=y
> > CONFIG_PROFILING=y
>
> I really don't like enabling CONFIG_EXPERT=y in a generic
> defconfig. What changes if you turn this off?
That's a good question.
Disabling it gives me material changes for 4 options:
--- .config.before
+++ .config.after
-CONFIG_EXPERT=y
-CONFIG_ARCH_HAS_ZONE_DMA_SET=y
+CONFIG_RFKILL_INPUT=y
-CONFIG_PCIE_BUS_DEFAULT=y
+CONFIG_DEBUG_MEMORY_INIT=y
1) CONFIG_DEBUG_MEMORY_INIT
The CONFIG_DEBUG_MEMORY_INIT default is super weird:
config DEBUG_MEMORY_INIT
bool "Debug memory initialisation" if EXPERT
default !EXPERT
I this might in fact be a bug, and Ubuntu might have fallen victim to
it:
.config.fedora: CONFIG_DEBUG_MEMORY_INIT=y
.config.ubuntu: # CONFIG_DEBUG_MEMORY_INIT is not set
I believe this should be 'default y', or 'default n'.
2) CONFIG_ARCH_HAS_ZONE_DMA_SET
This one is an interim Kconfig helper flag, and it's a bit weird as
well:
arch/x86/Kconfig: select ARCH_HAS_ZONE_DMA_SET if EXPERT
I *think* the intent here is to make configurability of ZONE_DMA and
ZONE_DMA32 dependent on EXPERT, while still giving architectures an
opt-in as well:
config ZONE_DMA
bool "Support DMA zone" if ARCH_HAS_ZONE_DMA_SET
default y if ARM64 || X86
config ZONE_DMA32
bool "Support DMA32 zone" if ARCH_HAS_ZONE_DMA_SET
depends on !X86_32
default y if ARM64
I think the better approach would be to make the EXPERT policy at the
ZONE_DMA and ZONE_DMA32 level:
bool "Support DMA zone" if ARCH_HAS_ZONE_DMA_SET && EXPERT
but it should be functionally equivalent.
3) RFKILL_INPUT
I think this one's a bug too:
config RFKILL_INPUT
bool "RF switch input support" if EXPERT
depends on RFKILL
depends on INPUT = y || RFKILL = INPUT
default y if !EXPERT
Basically if you turn on EXPERT, the default changes from Y to N.
I think this should be a plain 'default y'.
4) CONFIG_PCIE_BUS_DEFAULT
I think this is quite confusing code as well:
choice
prompt "PCI Express hierarchy optimization setting"
default PCIE_BUS_DEFAULT
depends on PCI && EXPERT
help
...
config PCIE_BUS_DEFAULT
bool "Default"
depends on PCI
help
Default choice; ensure that the MPS matches upstream bridge.
...
endchoice
So the intent here is clearly to steer users towards picking
PCIE_BUS_DEFAULT.
But the 'depends' line turns off the option entirely on !EXPERT.
Which happens to work due to how the config options are used by the PCI
code:
#ifdef CONFIG_PCIE_BUS_TUNE_OFF
enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_TUNE_OFF;
#elif defined CONFIG_PCIE_BUS_SAFE
enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_SAFE;
#elif defined CONFIG_PCIE_BUS_PERFORMANCE
enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_PERFORMANCE;
#elif defined CONFIG_PCIE_BUS_PEER2PEER
enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_PEER2PEER;
#else
enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_DEFAULT;
#endif
But this is highly unintuitive IMO. A cleaner implementation would be
to always have CONFIG_PCIE_BUS_DEFAULT enabled on !EXPERT, which can be
done by making the configurability of the choice-list depend on EXPERT:
choice
prompt "PCI Express hierarchy optimization setting" if EXPERT
default PCIE_BUS_DEFAULT
depends on PCI
> Based on the help text for CONFIG_EXPERT, nothing we
> consider the default should ever be guarded by it. If there
> is something that distros commonly that is prevented by
> EXPERT=n, it would be better to relay the dependency on that
> particular thing.
I think distro kernel maintainers mainly inherited their old configs
and aren't afraid of CONFIG_EXPERT.
Thus *all* major distros I checked have CONFIG_EXPERT enabled: Ubuntu,
Fedora, Debian, you name it. So literally over 99% of our users use a
kernel that has CONFIG_EXPERT=y in it. Which is perfectly fine, distro
kernel maintainers *are* the ultimate experts in this matter - but
their choices inevitably make it to users configuring their own
kernels: if users type 'make localmodconfig' they'll have
CONFIG_EXPERT=y.
So I don't think we should ostracize CONFIG_EXPERT too much. :)
Otherwise I think you were right: 2 out of 4 of the configuration
settings that change due to EXPERT are outright bugs IMO, the other 2
are weird code that could be done in a more standard fashion, resulting
in an invariant .config when EXPERT is toggled on/off.
Also, I kinda don't mind having CONFIG_EXPERT=y in the kernel
defconfig: it's a helper config for *kernel developers* who want to
have finegrained control over debug facilities and other details, it's
not something for users - the resulting kernels won't result in a fully
working system on modern x86 systems.
Thanks,
Ingo
next prev parent reply other threads:[~2025-05-07 16:09 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-06 17:09 [PATCH -v2 00/15] x86/kconfig: Enable various kernel features in the defconfig, add the 'x86_32' subarchitecture build target and misc cleanups Ingo Molnar
2025-05-06 17:09 ` [PATCH 01/15] x86/kconfig/64: Refresh defconfig Ingo Molnar
2025-05-07 5:31 ` Arnd Bergmann
2025-05-07 6:22 ` Ingo Molnar
2025-05-06 17:09 ` [PATCH 02/15] x86/kconfig/32: " Ingo Molnar
2025-05-06 17:09 ` [PATCH 03/15] x86/kconfig: Rename x86_64_defconfig to defconfig.x86_64 and i386_defconfig to defconfig.i386 Ingo Molnar
2025-05-09 18:10 ` Arnd Bergmann
2025-05-15 13:16 ` Ingo Molnar
2025-05-06 17:09 ` [PATCH 04/15] x86/kbuild: Introduce the 'x86_32' subarchitecture Ingo Molnar
2025-05-07 5:44 ` Arnd Bergmann
2025-05-07 6:35 ` Ingo Molnar
2025-05-09 12:04 ` David Laight
2025-05-09 18:00 ` H. Peter Anvin
2025-05-09 18:05 ` Arnd Bergmann
2025-05-06 17:09 ` [PATCH 05/15] x86/kbuild: Remove ancient 'arch/i386/' and 'arch/x86_64/' directory removal 'archclean' target Ingo Molnar
2025-05-06 17:09 ` [PATCH 06/15] x86/tools: insn_decoder_test.c: Emit standard build success messages Ingo Molnar
2025-05-06 17:09 ` [PATCH 07/15] x86/tools: insn_sanity.c: " Ingo Molnar
2025-05-06 17:09 ` [PATCH 08/15] x86/kconfig/64: Enable the KVM host in the defconfig Ingo Molnar
2025-05-06 17:09 ` [PATCH 09/15] x86/kconfig/64: Enable more virtualization guest options in the defconfig: enable Xen, Xen_PVH, Jailhouse, ACRN, Intel TDX and Hyper-V Ingo Molnar
2025-05-08 9:21 ` Jürgen Groß
2025-05-15 13:19 ` Ingo Molnar
2025-05-06 17:09 ` [PATCH 10/15] x86/kconfig/64: Enable BPF support in the defconfig Ingo Molnar
2025-05-06 17:09 ` [PATCH 11/15] x86/kconfig/64: Enable popular MM options " Ingo Molnar
2025-05-06 17:09 ` [PATCH 12/15] x86/kconfig/64: Enable popular kernel debugging " Ingo Molnar
2025-05-06 17:09 ` [PATCH 13/15] x86/kconfig/64: Enable popular scheduler, cgroups and namespaces " Ingo Molnar
2025-05-07 3:00 ` Yafang Shao
2025-05-07 7:06 ` Ingo Molnar
2025-05-07 11:42 ` Yafang Shao
2025-05-07 16:22 ` Ingo Molnar
2025-05-08 5:56 ` Yafang Shao
2025-05-22 5:49 ` Yafang Shao
2025-05-07 5:11 ` Arnd Bergmann
2025-05-07 16:09 ` Ingo Molnar [this message]
2025-05-28 17:22 ` Michal Koutný
2025-05-06 17:09 ` [PATCH 14/15] x86/kconfig/64: Enable popular generic kernel " Ingo Molnar
2025-05-06 17:09 ` [PATCH 15/15] x86/kconfig/32: Synchronize the x86-32 defconfig to the x86-64 defconfig Ingo Molnar
2025-05-07 5:27 ` Arnd Bergmann
2025-05-07 17:41 ` Ingo Molnar
2025-05-07 17:55 ` Arnd Bergmann
-- strict thread matches above, loose matches on Subject: below --
2025-05-05 11:09 [PATCH 00/15] x86/kconfig: Enable various kernel features in the defconfig, add the 'x86_32' subarchitecture build target and misc cleanups Ingo Molnar
2025-05-05 11:09 ` [PATCH 13/15] x86/kconfig/64: Enable popular scheduler, cgroups and namespaces options in the defconfig Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aBuFwQqQd3wldnHm@gmail.com \
--to=mingo@kernel.org \
--cc=ardb@kernel.org \
--cc=arnd@arndb.de \
--cc=bp@alien8.de \
--cc=dwmw@amazon.co.uk \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.lkml@markovi.net \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=vkuznets@redhat.com \
--cc=yamada.masahiro@socionext.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome