public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sofirq: make rcu_irq_enter()/rcu_irq_exit() called in pairs
@ 2009-10-27  8:00 Lai Jiangshan
  2009-10-27 14:30 ` Paul E. McKenney
  0 siblings, 1 reply; 2+ messages in thread
From: Lai Jiangshan @ 2009-10-27  8:00 UTC (permalink / raw)
  To: Paul E. McKenney, Ingo Molnar, Thomas Gleixner, LKML


irq_enter() calls rcu_irq_enter() unconditionally,
the same as irq_exit() calls rcu_irq_exit().

It does not change the binary because rcu_irq_enter()
is dummy when !CONFIG_NO_HZ.

It's just a cleanup.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
diff --git a/kernel/softirq.c b/kernel/softirq.c
index f8749e5..21939d9 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -302,9 +302,9 @@ void irq_exit(void)
 	if (!in_interrupt() && local_softirq_pending())
 		invoke_softirq();
 
+	rcu_irq_exit();
 #ifdef CONFIG_NO_HZ
 	/* Make sure that timer wheel updates are propagated */
-	rcu_irq_exit();
 	if (idle_cpu(smp_processor_id()) && !in_interrupt() && !need_resched())
 		tick_nohz_stop_sched_tick(0);
 #endif


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

* Re: [PATCH] sofirq: make rcu_irq_enter()/rcu_irq_exit() called in pairs
  2009-10-27  8:00 [PATCH] sofirq: make rcu_irq_enter()/rcu_irq_exit() called in pairs Lai Jiangshan
@ 2009-10-27 14:30 ` Paul E. McKenney
  0 siblings, 0 replies; 2+ messages in thread
From: Paul E. McKenney @ 2009-10-27 14:30 UTC (permalink / raw)
  To: Lai Jiangshan; +Cc: Ingo Molnar, Thomas Gleixner, LKML

On Tue, Oct 27, 2009 at 04:00:11PM +0800, Lai Jiangshan wrote:
> 
> irq_enter() calls rcu_irq_enter() unconditionally,
> the same as irq_exit() calls rcu_irq_exit().
> 
> It does not change the binary because rcu_irq_enter()
> is dummy when !CONFIG_NO_HZ.
> 
> It's just a cleanup.

This does look like a nice cleanup!  I will pull it in and test it.

Yes, it should be provably the same, but RCU has taught me to be quite
paranoid.  ;-)

						Thanx, Paul

> Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
> ---
> diff --git a/kernel/softirq.c b/kernel/softirq.c
> index f8749e5..21939d9 100644
> --- a/kernel/softirq.c
> +++ b/kernel/softirq.c
> @@ -302,9 +302,9 @@ void irq_exit(void)
>  	if (!in_interrupt() && local_softirq_pending())
>  		invoke_softirq();
> 
> +	rcu_irq_exit();
>  #ifdef CONFIG_NO_HZ
>  	/* Make sure that timer wheel updates are propagated */
> -	rcu_irq_exit();
>  	if (idle_cpu(smp_processor_id()) && !in_interrupt() && !need_resched())
>  		tick_nohz_stop_sched_tick(0);
>  #endif
> 

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

end of thread, other threads:[~2009-10-27 14:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-27  8:00 [PATCH] sofirq: make rcu_irq_enter()/rcu_irq_exit() called in pairs Lai Jiangshan
2009-10-27 14:30 ` Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox