Message ID | 20210822080112.3123-1-rsalvaterra@gmail.com |
---|---|
State | Superseded |
Headers | show |
Series | kernel: disable CONFIG_RCU_EXPERT and friends | expand |
On 8/22/21 10:01 AM, Rui Salvaterra wrote: > Based on the existing documentation [1][2], I dare anyone to demonstrate that > we need to fine-tune these RCU parameters. The (performance) breakage potential > for doing so is immense, so let's just please put down this loaded footgun. > Disable CONFIG_RCU_EXPERT and dependent symbols. > > [1] https://www.kernel.org/doc/Documentation/RCU/Design/Data-Structures/Data-Structures.html > [2] https://lwn.net/Articles/777214/ > > Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com> There are also some targets which explicitly unset CONFIG_RCU_EXPERT: $ git grep CONFIG_RCU_EXPERT target/linux/gemini/config-5.10:# CONFIG_RCU_EXPERT is not set target/linux/gemini/config-5.4:# CONFIG_RCU_EXPERT is not set target/linux/generic/config-5.10:CONFIG_RCU_EXPERT=y target/linux/generic/config-5.4:CONFIG_RCU_EXPERT=y target/linux/ipq807x/config-default:# CONFIG_RCU_EXPERT is not set target/linux/layerscape/armv7/config-5.4:# CONFIG_RCU_EXPERT is not set target/linux/layerscape/armv8_64b/config-5.4:# CONFIG_RCU_EXPERT is not set target/linux/mediatek/mt7623/config-5.10:# CONFIG_RCU_EXPERT is not set target/linux/oxnas/ox810se/config-default:# CONFIG_RCU_EXPERT is not set target/linux/oxnas/ox820/config-default:# CONFIG_RCU_EXPERT is not set target/linux/rockchip/armv8/config-5.10:# CONFIG_RCU_EXPERT is not set target/linux/rockchip/armv8/config-5.4:# CONFIG_RCU_EXPERT is not set target/linux/tegra/config-5.10:# CONFIG_RCU_EXPERT is not set target/linux/tegra/config-5.4:# CONFIG_RCU_EXPERT is not set This should be removed from the target config file. CONFIG_RCU_STALL_COMMON=y and CONFIG_RCU_NEED_SEGCBLIST=y are also set in most target configurations. Should we move them to the generic configuration? Hauke > --- > target/linux/generic/config-5.10 | 7 +------ > target/linux/generic/config-5.4 | 6 +----- > 2 files changed, 2 insertions(+), 11 deletions(-) > > diff --git a/target/linux/generic/config-5.10 b/target/linux/generic/config-5.10 > index f944f1718f..91f137fbc3 100644 > --- a/target/linux/generic/config-5.10 > +++ b/target/linux/generic/config-5.10 > @@ -4631,12 +4631,8 @@ CONFIG_PWRSEQ_SIMPLE=y > CONFIG_RCU_CPU_STALL_TIMEOUT=60 > # CONFIG_RCU_EQS_DEBUG is not set > # CONFIG_RCU_EXPEDITE_BOOT is not set > -CONFIG_RCU_EXPERT=y > -CONFIG_RCU_FANOUT=32 > -CONFIG_RCU_FANOUT_LEAF=16 > -# CONFIG_RCU_FAST_NO_HZ is not set > +# CONFIG_RCU_EXPERT is not set > CONFIG_RCU_KTHREAD_PRIO=0 > -# CONFIG_RCU_NOCB_CPU is not set > # CONFIG_RCU_PERF_TEST is not set > # CONFIG_RCU_REF_SCALE_TEST is not set > # CONFIG_RCU_SCALE_TEST is not set > @@ -5995,7 +5991,6 @@ CONFIG_SYSVIPC_SYSCTL=y > # CONFIG_TARGET_CORE is not set > # CONFIG_TASKSTATS is not set > # CONFIG_TASKS_RCU is not set > -CONFIG_TASKS_TRACE_RCU_READ_MB=y > # CONFIG_TASK_XACCT is not set > # CONFIG_TC35815 is not set > # CONFIG_TCG_ATMEL is not set > diff --git a/target/linux/generic/config-5.4 b/target/linux/generic/config-5.4 > index 45d8f0976e..06f5e43a6d 100644 > --- a/target/linux/generic/config-5.4 > +++ b/target/linux/generic/config-5.4 > @@ -4262,12 +4262,8 @@ CONFIG_PWRSEQ_SIMPLE=y > CONFIG_RCU_CPU_STALL_TIMEOUT=60 > # CONFIG_RCU_EQS_DEBUG is not set > # CONFIG_RCU_EXPEDITE_BOOT is not set > -CONFIG_RCU_EXPERT=y > -CONFIG_RCU_FANOUT=32 > -CONFIG_RCU_FANOUT_LEAF=16 > -# CONFIG_RCU_FAST_NO_HZ is not set > +# CONFIG_RCU_EXPERT is not set > CONFIG_RCU_KTHREAD_PRIO=0 > -# CONFIG_RCU_NOCB_CPU is not set > # CONFIG_RCU_PERF_TEST is not set > # CONFIG_RCU_TORTURE_TEST is not set > CONFIG_RCU_TORTURE_TEST_SLOW_INIT_DELAY=3 >
Hi, Hauke, On Sun, 22 Aug 2021 at 10:20, Hauke Mehrtens <hauke@hauke-m.de> wrote: > > There are also some targets which explicitly unset CONFIG_RCU_EXPERT: [snipped] > This should be removed from the target config file. Sure thing, I'll clean up the targets and fold the changes into this patch. > CONFIG_RCU_STALL_COMMON=y and CONFIG_RCU_NEED_SEGCBLIST=y are also set > in most target configurations. Should we move them to the generic > configuration? Good question. Those symbols are only relevant when tree RCU is enabled, which is everything except non-preemptible, non-SMP kernels. We don't enable preemption, so basically these will only be relevant for SMP devices. That said, I believe moving them to the generic kconfigs is the right thing to do. Do you agree? Cheers, Rui
On 8/22/21 2:17 PM, Rui Salvaterra wrote: > Hi, Hauke, > > On Sun, 22 Aug 2021 at 10:20, Hauke Mehrtens <hauke@hauke-m.de> wrote: >> >> There are also some targets which explicitly unset CONFIG_RCU_EXPERT: > > [snipped] > >> This should be removed from the target config file. > > Sure thing, I'll clean up the targets and fold the changes into this patch. > >> CONFIG_RCU_STALL_COMMON=y and CONFIG_RCU_NEED_SEGCBLIST=y are also set >> in most target configurations. Should we move them to the generic >> configuration? > > Good question. Those symbols are only relevant when tree RCU is > enabled, which is everything except non-preemptible, non-SMP kernels. > We don't enable preemption, so basically these will only be relevant > for SMP devices. That said, I believe moving them to the generic > kconfigs is the right thing to do. Do you agree? Both options are hidden anyway, so we can manually change them: config RCU_STALL_COMMON def_bool ( TREE_RCU || PREEMPT_RCU ) help config RCU_NEED_SEGCBLIST def_bool ( TREE_RCU || PREEMPT_RCU || TREE_SRCU ) They are automatically activated when the dependencies are satisfied. I would add this to the generic kernel configurations and remove the individual ones in a separate patch: CONFIG_RCU_STALL_COMMON=y CONFIG_RCU_NEED_SEGCBLIST=y Hauke
Hi, Hauke, On Sun, 22 Aug 2021 at 13:45, Hauke Mehrtens <hauke@hauke-m.de> wrote: > > Both options are hidden anyway, so we can manually change them: > > config RCU_STALL_COMMON > def_bool ( TREE_RCU || PREEMPT_RCU ) > help > > config RCU_NEED_SEGCBLIST > def_bool ( TREE_RCU || PREEMPT_RCU || TREE_SRCU ) > > They are automatically activated when the dependencies are satisfied. > > I would add this to the generic kernel configurations and remove the > individual ones in a separate patch: > CONFIG_RCU_STALL_COMMON=y > CONFIG_RCU_NEED_SEGCBLIST=y Great, will do. But since this change will be much larger (even if mechanical), I'll send it as a second patch. Thanks, Rui
diff --git a/target/linux/generic/config-5.10 b/target/linux/generic/config-5.10 index f944f1718f..91f137fbc3 100644 --- a/target/linux/generic/config-5.10 +++ b/target/linux/generic/config-5.10 @@ -4631,12 +4631,8 @@ CONFIG_PWRSEQ_SIMPLE=y CONFIG_RCU_CPU_STALL_TIMEOUT=60 # CONFIG_RCU_EQS_DEBUG is not set # CONFIG_RCU_EXPEDITE_BOOT is not set -CONFIG_RCU_EXPERT=y -CONFIG_RCU_FANOUT=32 -CONFIG_RCU_FANOUT_LEAF=16 -# CONFIG_RCU_FAST_NO_HZ is not set +# CONFIG_RCU_EXPERT is not set CONFIG_RCU_KTHREAD_PRIO=0 -# CONFIG_RCU_NOCB_CPU is not set # CONFIG_RCU_PERF_TEST is not set # CONFIG_RCU_REF_SCALE_TEST is not set # CONFIG_RCU_SCALE_TEST is not set @@ -5995,7 +5991,6 @@ CONFIG_SYSVIPC_SYSCTL=y # CONFIG_TARGET_CORE is not set # CONFIG_TASKSTATS is not set # CONFIG_TASKS_RCU is not set -CONFIG_TASKS_TRACE_RCU_READ_MB=y # CONFIG_TASK_XACCT is not set # CONFIG_TC35815 is not set # CONFIG_TCG_ATMEL is not set diff --git a/target/linux/generic/config-5.4 b/target/linux/generic/config-5.4 index 45d8f0976e..06f5e43a6d 100644 --- a/target/linux/generic/config-5.4 +++ b/target/linux/generic/config-5.4 @@ -4262,12 +4262,8 @@ CONFIG_PWRSEQ_SIMPLE=y CONFIG_RCU_CPU_STALL_TIMEOUT=60 # CONFIG_RCU_EQS_DEBUG is not set # CONFIG_RCU_EXPEDITE_BOOT is not set -CONFIG_RCU_EXPERT=y -CONFIG_RCU_FANOUT=32 -CONFIG_RCU_FANOUT_LEAF=16 -# CONFIG_RCU_FAST_NO_HZ is not set +# CONFIG_RCU_EXPERT is not set CONFIG_RCU_KTHREAD_PRIO=0 -# CONFIG_RCU_NOCB_CPU is not set # CONFIG_RCU_PERF_TEST is not set # CONFIG_RCU_TORTURE_TEST is not set CONFIG_RCU_TORTURE_TEST_SLOW_INIT_DELAY=3
Based on the existing documentation [1][2], I dare anyone to demonstrate that we need to fine-tune these RCU parameters. The (performance) breakage potential for doing so is immense, so let's just please put down this loaded footgun. Disable CONFIG_RCU_EXPERT and dependent symbols. [1] https://www.kernel.org/doc/Documentation/RCU/Design/Data-Structures/Data-Structures.html [2] https://lwn.net/Articles/777214/ Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com> --- target/linux/generic/config-5.10 | 7 +------ target/linux/generic/config-5.4 | 6 +----- 2 files changed, 2 insertions(+), 11 deletions(-)