[PATCH 3/7] rcu: fix header guard for rcu_all_qs()

Ankur Arora posted 7 patches 1 month, 2 weeks ago
[PATCH 3/7] rcu: fix header guard for rcu_all_qs()
Posted by Ankur Arora 1 month, 2 weeks ago
rcu_all_qs() is defined for !CONFIG_PREEMPT_RCU but the declaration
is conditioned on CONFIG_PREEMPTION.

With CONFIG_PREEMPT_LAZY, CONFIG_PREEMPTION=y does not imply
CONFIG_PREEMPT_RCU=y.

Decouple the two.

Cc: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Ankur Arora <ankur.a.arora@oracle.com>
---
 include/linux/rcutree.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
index 90a684f94776..ae8b5cb475a3 100644
--- a/include/linux/rcutree.h
+++ b/include/linux/rcutree.h
@@ -104,7 +104,7 @@ extern int rcu_scheduler_active;
 void rcu_end_inkernel_boot(void);
 bool rcu_inkernel_boot_has_ended(void);
 bool rcu_is_watching(void);
-#ifndef CONFIG_PREEMPTION
+#ifndef CONFIG_PREEMPT_RCU
 void rcu_all_qs(void);
 #endif
 
-- 
2.43.5
Re: [PATCH 3/7] rcu: fix header guard for rcu_all_qs()
Posted by Sebastian Andrzej Siewior 1 month, 2 weeks ago
On 2024-10-09 09:54:07 [-0700], Ankur Arora wrote:
> rcu_all_qs() is defined for !CONFIG_PREEMPT_RCU but the declaration
> is conditioned on CONFIG_PREEMPTION.
> 
> With CONFIG_PREEMPT_LAZY, CONFIG_PREEMPTION=y does not imply
> CONFIG_PREEMPT_RCU=y.

From kernel/rcu/Kconfig:
| config PREEMPT_RCU
|         bool
|         default y if PREEMPTION

this looks like PREEMPT_RCU implies PREEMPTION.

> Decouple the two.

Sebastian
Re: [PATCH 3/7] rcu: fix header guard for rcu_all_qs()
Posted by Peter Zijlstra 1 month, 2 weeks ago
On Thu, Oct 10, 2024 at 08:41:23AM +0200, Sebastian Andrzej Siewior wrote:
> On 2024-10-09 09:54:07 [-0700], Ankur Arora wrote:
> > rcu_all_qs() is defined for !CONFIG_PREEMPT_RCU but the declaration
> > is conditioned on CONFIG_PREEMPTION.
> > 
> > With CONFIG_PREEMPT_LAZY, CONFIG_PREEMPTION=y does not imply
> > CONFIG_PREEMPT_RCU=y.
> 
> From kernel/rcu/Kconfig:
> | config PREEMPT_RCU
> |         bool
> |         default y if PREEMPTION
> 
> this looks like PREEMPT_RCU implies PREEMPTION.

The point was to make PREEMPT_RCU=n possible even when PREEMPTION=y,
which is fine.
Re: [PATCH 3/7] rcu: fix header guard for rcu_all_qs()
Posted by Paul E. McKenney 1 month, 2 weeks ago
On Thu, Oct 10, 2024 at 10:11:29AM +0200, Peter Zijlstra wrote:
> On Thu, Oct 10, 2024 at 08:41:23AM +0200, Sebastian Andrzej Siewior wrote:
> > On 2024-10-09 09:54:07 [-0700], Ankur Arora wrote:
> > > rcu_all_qs() is defined for !CONFIG_PREEMPT_RCU but the declaration
> > > is conditioned on CONFIG_PREEMPTION.
> > > 
> > > With CONFIG_PREEMPT_LAZY, CONFIG_PREEMPTION=y does not imply
> > > CONFIG_PREEMPT_RCU=y.
> > 
> > From kernel/rcu/Kconfig:
> > | config PREEMPT_RCU
> > |         bool
> > |         default y if PREEMPTION
> > 
> > this looks like PREEMPT_RCU implies PREEMPTION.
> 
> The point was to make PREEMPT_RCU=n possible even when PREEMPTION=y,
> which is fine.

Agreed!

							Thanx, Paul