All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] rcu: Make rcu_normal_after_boot writable again
@ 2021-08-10  8:48 Juri Lelli
  2021-08-10  8:48 ` [PATCH v2 1/2] " Juri Lelli
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Juri Lelli @ 2021-08-10  8:48 UTC (permalink / raw)
  To: paulmck, josh
  Cc: linux-kernel, linux-rt-users, peterz, bigeasy, tglx, rostedt,
	mathieu.desnoyers, jiangshanlai, joel, rcu, Juri Lelli

Hi,

v2 of a proposed RCU change to make rcu_normal_after_boot feature usable
on PREEMPT_RT as well, as it turns out it's useful on RT as well on
NO_HZ_FULL configurations.

v2 gained an additional patch to revise rcu update module parameters
permissions (as suggested during v1 review [1]).

Changes wrt v1:

 - Restrict the option to !PREEMPT_RT || NO_HZ_FULL (Paul, Sebastian)
 - Change module params permissions (Paul) (02/02)

Thanks,
Juri

v1 - https://lore.kernel.org/lkml/20210805080123.16320-1-juri.lelli@redhat.com/

Juri Lelli (2):
  rcu: Make rcu_normal_after_boot writable again
  rcu: Make rcu update module parameters world-readable

 kernel/rcu/tree_exp.h | 1 -
 kernel/rcu/update.c   | 8 ++++----
 2 files changed, 4 insertions(+), 5 deletions(-)

-- 
2.31.1


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

* [PATCH v2 1/2] rcu: Make rcu_normal_after_boot writable again
  2021-08-10  8:48 [PATCH v2 0/2] rcu: Make rcu_normal_after_boot writable again Juri Lelli
@ 2021-08-10  8:48 ` Juri Lelli
  2021-08-10  8:48 ` [PATCH v2 2/2] rcu: Make rcu update module parameters world-readable Juri Lelli
  2021-08-10 18:41 ` [PATCH v2 0/2] rcu: Make rcu_normal_after_boot writable again Paul E. McKenney
  2 siblings, 0 replies; 4+ messages in thread
From: Juri Lelli @ 2021-08-10  8:48 UTC (permalink / raw)
  To: paulmck, josh
  Cc: linux-kernel, linux-rt-users, peterz, bigeasy, tglx, rostedt,
	mathieu.desnoyers, jiangshanlai, joel, rcu, Juri Lelli

Certain configurations (e.g., systems that make heavy use of netns)
need to use synchronize_rcu_expedited() to service RCU grace periods
even after boot.

Even though synchronize_rcu_expedited() has been traditionally
considered harmful for RT for the heavy use of IPIs, it is perfectly
usable under certain conditions (e.g. nohz_full).

Make rcupdate.rcu_normal_after_boot= again writeable on RT (if NO_HZ_
FULL is defined), but keep its default value to 1 (enabled) to avoid
regressions. Users who need synchronize_rcu_expedited() will boot with
rcupdate.rcu_normal_after_ boot=0 in the kernel cmdline.

Reflect the change in synchronize_rcu_expedited_wait() by removing the
WARN related to CONFIG_PREEMPT_RT.

Signed-off-by: Juri Lelli <juri.lelli@redhat.com>
---
 kernel/rcu/tree_exp.h | 1 -
 kernel/rcu/update.c   | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/kernel/rcu/tree_exp.h b/kernel/rcu/tree_exp.h
index 2796084ef85a..d9e4f8eb9ae2 100644
--- a/kernel/rcu/tree_exp.h
+++ b/kernel/rcu/tree_exp.h
@@ -512,7 +512,6 @@ static void synchronize_rcu_expedited_wait(void)
 		j = READ_ONCE(jiffies_till_first_fqs);
 		if (synchronize_rcu_expedited_wait_once(j + HZ))
 			return;
-		WARN_ON_ONCE(IS_ENABLED(CONFIG_PREEMPT_RT));
 	}
 
 	for (;;) {
diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c
index c21b38cc25e9..bd551134e2f4 100644
--- a/kernel/rcu/update.c
+++ b/kernel/rcu/update.c
@@ -57,7 +57,7 @@
 module_param(rcu_expedited, int, 0);
 module_param(rcu_normal, int, 0);
 static int rcu_normal_after_boot = IS_ENABLED(CONFIG_PREEMPT_RT);
-#ifndef CONFIG_PREEMPT_RT
+#if !defined(CONFIG_PREEMPT_RT) || defined(CONFIG_NO_HZ_FULL)
 module_param(rcu_normal_after_boot, int, 0);
 #endif
 #endif /* #ifndef CONFIG_TINY_RCU */
-- 
2.31.1


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

* [PATCH v2 2/2] rcu: Make rcu update module parameters world-readable
  2021-08-10  8:48 [PATCH v2 0/2] rcu: Make rcu_normal_after_boot writable again Juri Lelli
  2021-08-10  8:48 ` [PATCH v2 1/2] " Juri Lelli
@ 2021-08-10  8:48 ` Juri Lelli
  2021-08-10 18:41 ` [PATCH v2 0/2] rcu: Make rcu_normal_after_boot writable again Paul E. McKenney
  2 siblings, 0 replies; 4+ messages in thread
From: Juri Lelli @ 2021-08-10  8:48 UTC (permalink / raw)
  To: paulmck, josh
  Cc: linux-kernel, linux-rt-users, peterz, bigeasy, tglx, rostedt,
	mathieu.desnoyers, jiangshanlai, joel, rcu, Juri Lelli

rcu update module parameters currently don't appear in sysfs and this is
a serviceability issue as it might be needed to access their default
values at runtime.

Fix this issue by changing rcu update module parameters permissions to
world-readable.

Suggested-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Juri Lelli <juri.lelli@redhat.com>
---
 kernel/rcu/update.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c
index bd551134e2f4..94282dc12bab 100644
--- a/kernel/rcu/update.c
+++ b/kernel/rcu/update.c
@@ -54,11 +54,11 @@
 #define MODULE_PARAM_PREFIX "rcupdate."
 
 #ifndef CONFIG_TINY_RCU
-module_param(rcu_expedited, int, 0);
-module_param(rcu_normal, int, 0);
+module_param(rcu_expedited, int, 0444);
+module_param(rcu_normal, int, 0444);
 static int rcu_normal_after_boot = IS_ENABLED(CONFIG_PREEMPT_RT);
 #if !defined(CONFIG_PREEMPT_RT) || defined(CONFIG_NO_HZ_FULL)
-module_param(rcu_normal_after_boot, int, 0);
+module_param(rcu_normal_after_boot, int, 0444);
 #endif
 #endif /* #ifndef CONFIG_TINY_RCU */
 
-- 
2.31.1


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

* Re: [PATCH v2 0/2] rcu: Make rcu_normal_after_boot writable again
  2021-08-10  8:48 [PATCH v2 0/2] rcu: Make rcu_normal_after_boot writable again Juri Lelli
  2021-08-10  8:48 ` [PATCH v2 1/2] " Juri Lelli
  2021-08-10  8:48 ` [PATCH v2 2/2] rcu: Make rcu update module parameters world-readable Juri Lelli
@ 2021-08-10 18:41 ` Paul E. McKenney
  2 siblings, 0 replies; 4+ messages in thread
From: Paul E. McKenney @ 2021-08-10 18:41 UTC (permalink / raw)
  To: Juri Lelli
  Cc: josh, linux-kernel, linux-rt-users, peterz, bigeasy, tglx,
	rostedt, mathieu.desnoyers, jiangshanlai, joel, rcu

On Tue, Aug 10, 2021 at 10:48:14AM +0200, Juri Lelli wrote:
> Hi,
> 
> v2 of a proposed RCU change to make rcu_normal_after_boot feature usable
> on PREEMPT_RT as well, as it turns out it's useful on RT as well on
> NO_HZ_FULL configurations.
> 
> v2 gained an additional patch to revise rcu update module parameters
> permissions (as suggested during v1 review [1]).

Queued and pushed, thank you!

							Thanx, Paul

> Changes wrt v1:
> 
>  - Restrict the option to !PREEMPT_RT || NO_HZ_FULL (Paul, Sebastian)
>  - Change module params permissions (Paul) (02/02)
> 
> Thanks,
> Juri
> 
> v1 - https://lore.kernel.org/lkml/20210805080123.16320-1-juri.lelli@redhat.com/
> 
> Juri Lelli (2):
>   rcu: Make rcu_normal_after_boot writable again
>   rcu: Make rcu update module parameters world-readable
> 
>  kernel/rcu/tree_exp.h | 1 -
>  kernel/rcu/update.c   | 8 ++++----
>  2 files changed, 4 insertions(+), 5 deletions(-)
> 
> -- 
> 2.31.1
> 

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

end of thread, other threads:[~2021-08-10 18:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-10  8:48 [PATCH v2 0/2] rcu: Make rcu_normal_after_boot writable again Juri Lelli
2021-08-10  8:48 ` [PATCH v2 1/2] " Juri Lelli
2021-08-10  8:48 ` [PATCH v2 2/2] rcu: Make rcu update module parameters world-readable Juri Lelli
2021-08-10 18:41 ` [PATCH v2 0/2] rcu: Make rcu_normal_after_boot writable again Paul E. McKenney

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.