Skip to contentSkip to conversation

fixes to include/linux/rcupreempt.h

PATCH Applied Paul E. McKenney 3 participants 5 messages Aug 1, 2008 – Aug 21, 2008 RCU

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fixes to include/linux/rcupreempt.h

Hello!

Compared tip/core/rcu to my latest patchset, and found the following issues:

o the memory barrier in rcu_exit_nohz() somehow got out of place
(it is correct in mainline as of 2.6.26-rc7).

o There is a duplicate declaration of rcu_dyntick_sched.

The attached patch fixes these.

---

include/linux/rcupreempt.h +1 -2
index f04b64e..84678bf 100644
@@ -111,7 +111,6 @@ extern struct rcupreempt_trace *rcupreempt_trace_cpu(int cpu);
 struct softirq_action;
 
 #ifdef CONFIG_NO_HZ
-DECLARE_PER_CPU(struct rcu_dyntick_sched, rcu_dyntick_sched);
 
 static inline void rcu_enter_nohz(void)
 {
@@ -122,8 +121,8 @@ static inline void rcu_enter_nohz(void)
 
 static inline void rcu_exit_nohz(void)
 {
-	smp_mb(); /* CPUs seeing ++ must see later RCU read-side crit sects */
 	__get_cpu_var(rcu_dyntick_sched).dynticks++;
+	smp_mb(); /* CPUs seeing ++ must see later RCU read-side crit sects */
 	WARN_ON(!(__get_cpu_var(rcu_dyntick_sched).dynticks & 0x1));
 }
 
Applied
#1 lore raw
Quoted 5 lines · Paul E. McKenney

Hello!

Compared tip/core/rcu to my latest patchset, and found the following issues:

Quoted 8 lines

o the memory barrier in rcu_exit_nohz() somehow got out of place
(it is correct in mainline as of 2.6.26-rc7).

o There is a duplicate declaration of rcu_dyntick_sched.

The attached patch fixes these.

applied to tip/core/rcu - thanks Paul.

Ingo

#2 lore raw
In reply to Paul E. McKenney

Sorry for the late post, I'm finally looking at all my -rt mail.

Quoted 20 lines · Paul E. McKenney

Hello!

Compared tip/core/rcu to my latest patchset, and found the following issues:

o the memory barrier in rcu_exit_nohz() somehow got out of place
(it is correct in mainline as of 2.6.26-rc7).

o There is a duplicate declaration of rcu_dyntick_sched.

The attached patch fixes these.

---

include/linux/rcupreempt.h +0 -0
index f04b64e..84678bf 100644

include/linux/rcupreempt.h extern struct rcupreempt_trace *rcupreempt_trace_cpu(int cpu); · line 114

Quoted 4 lines
include/linux/rcupreempt.h +0 -1
@@ -111,7 +111,6 @@ extern struct rcupreempt_trace *rcupreempt_trace_cpu(int cpu);
 struct softirq_action;
 
 #ifdef CONFIG_NO_HZ
-DECLARE_PER_CPU(struct rcu_dyntick_sched, rcu_dyntick_sched);

In -rt we deleted the first declaration. Is rcu_dyntick_sched defined on !CONFIG_NO_HZ?

-- Steve

Quoted 14 lines
include/linux/rcupreempt.h +1 -1
 static inline void rcu_enter_nohz(void)
 {
@@ -122,8 +121,8 @@ static inline void rcu_enter_nohz(void)
 
 static inline void rcu_exit_nohz(void)
 {
-	smp_mb(); /* CPUs seeing ++ must see later RCU read-side crit sects */
 	__get_cpu_var(rcu_dyntick_sched).dynticks++;
+	smp_mb(); /* CPUs seeing ++ must see later RCU read-side crit sects */
 	WARN_ON(!(__get_cpu_var(rcu_dyntick_sched).dynticks & 0x1));
 }
 
#3 lore raw
Quoted 28 lines · Steven Rostedt

Sorry for the late post, I'm finally looking at all my -rt mail.

Quoted 22 lines · Paul E. McKenney

Hello!

Compared tip/core/rcu to my latest patchset, and found the following issues:

o the memory barrier in rcu_exit_nohz() somehow got out of place
(it is correct in mainline as of 2.6.26-rc7).

o There is a duplicate declaration of rcu_dyntick_sched.

The attached patch fixes these.

---

include/linux/rcupreempt.h +0 -0
index f04b64e..84678bf 100644
@@ -111,7 +111,6 @@ extern struct rcupreempt_trace *rcupreempt_trace_cpu(int cpu);
 struct softirq_action;
 
Quoted 5 lines

include/linux/rcupreempt.h extern struct rcupreempt_trace *rcupreempt_trace_cpu(int cpu); · line 114

Quoted 2 lines
include/linux/rcupreempt.h +0 -1
 #ifdef CONFIG_NO_HZ
-DECLARE_PER_CPU(struct rcu_dyntick_sched, rcu_dyntick_sched);

In -rt we deleted the first declaration. Is rcu_dyntick_sched defined on !CONFIG_NO_HZ?

It builds for me in current tip/core/rcu without the above DECLARE_PER_CPU(). And the reason is the call_rcu_sched() function, which requires rcu_dyntick_sched.sched_qs and rcu_dyntick_sched.sched_qs_snap be defined even if !CONFIG_NO_HZ.

I suppose I could remove the other elements from the rcu_dyntick_sched structure if !CONFIG_NO_HZ. Worthwhile?

Thanx, Paul

Quoted 16 lines

-- Steve

Quoted 14 lines
include/linux/rcupreempt.h +1 -1
 static inline void rcu_enter_nohz(void)
 {
@@ -122,8 +121,8 @@ static inline void rcu_enter_nohz(void)
 
 static inline void rcu_exit_nohz(void)
 {
-	smp_mb(); /* CPUs seeing ++ must see later RCU read-side crit sects */
 	__get_cpu_var(rcu_dyntick_sched).dynticks++;
+	smp_mb(); /* CPUs seeing ++ must see later RCU read-side crit sects */
 	WARN_ON(!(__get_cpu_var(rcu_dyntick_sched).dynticks & 0x1));
 }
 
#4 lore raw
Quoted 5 lines · Paul E. McKenney
Quoted 4 lines
Quoted 1 line

-DECLARE_PER_CPU(struct rcu_dyntick_sched, rcu_dyntick_sched);

In -rt we deleted the first declaration. Is rcu_dyntick_sched defined on !CONFIG_NO_HZ?

Quoted 8 lines

It builds for me in current tip/core/rcu without the above DECLARE_PER_CPU(). And the reason is the call_rcu_sched() function, which requires rcu_dyntick_sched.sched_qs and rcu_dyntick_sched.sched_qs_snap be defined even if !CONFIG_NO_HZ.

I suppose I could remove the other elements from the rcu_dyntick_sched structure if !CONFIG_NO_HZ. Worthwhile?

Nah, forget about it. I've got a few different versions I'm dealing with.

Thanks,

-- Steve