public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] netpoll: use non-BH variant of RCU
       [not found]           ` <20100813162912.GJ2511@linux.vnet.ibm.com>
@ 2010-08-13 17:51             ` Herbert Xu
  2010-08-15  6:50               ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Herbert Xu @ 2010-08-13 17:51 UTC (permalink / raw)
  To: Paul E. McKenney
  Cc: David Miller, linville, netdev, Ingo Molnar,
	Linux Kernel Mailing List

On Fri, Aug 13, 2010 at 09:29:12AM -0700, Paul E. McKenney wrote:
>
> > But this doesn't really solve the problem for netif_rx.  The reason
> > is that netif_rx can either be called with IRQs on OR off.  So we
> > need to take the right precautions in the case where IRQs are
> > enabled along with BH.
> 
> Interesting...
> 
> Is it possible that IRQs are off at rcu_read_lock_bh_irqsoff() time, but
> enabled by the time we get to rcu_read_unlock_bh_irqsoff()?  I hope not,
> but have to ask.  If I am guaranteed of the same state in both cases,
> I can do something like the following:

Yes in our case it's certainly guaranteed that IRQs will remain
off.
 
> But all in all, mightn't it be easier to remove the checks from
> _local_bh_enable(), and then just use rcu_read_lock_bh()?  Have those
> checks really been that helpful in finding bugs?  ;-)

You are right.  It would be much simpler to simply have it not
warn.

Cheers,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

* Re: [PATCH] netpoll: use non-BH variant of RCU
  2010-08-13 17:51             ` [PATCH] netpoll: use non-BH variant of RCU Herbert Xu
@ 2010-08-15  6:50               ` David Miller
  2010-09-02 17:26                 ` Paul E. McKenney
  0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2010-08-15  6:50 UTC (permalink / raw)
  To: herbert; +Cc: paulmck, linville, netdev, mingo, linux-kernel

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Fri, 13 Aug 2010 13:51:57 -0400

> On Fri, Aug 13, 2010 at 09:29:12AM -0700, Paul E. McKenney wrote:
>> But all in all, mightn't it be easier to remove the checks from
>> _local_bh_enable(), and then just use rcu_read_lock_bh()?  Have those
>> checks really been that helpful in finding bugs?  ;-)
> 
> You are right.  It would be much simpler to simply have it not
> warn.

For now I'm going to assume that this is how the issue will be
addressed.

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

* Re: [PATCH] netpoll: use non-BH variant of RCU
  2010-08-15  6:50               ` David Miller
@ 2010-09-02 17:26                 ` Paul E. McKenney
  2010-09-03 15:34                   ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Paul E. McKenney @ 2010-09-02 17:26 UTC (permalink / raw)
  To: David Miller; +Cc: herbert, linville, netdev, mingo, linux-kernel, peterz

On Sat, Aug 14, 2010 at 11:50:33PM -0700, David Miller wrote:
> From: Herbert Xu <herbert@gondor.apana.org.au>
> Date: Fri, 13 Aug 2010 13:51:57 -0400
> 
> > On Fri, Aug 13, 2010 at 09:29:12AM -0700, Paul E. McKenney wrote:
> >> But all in all, mightn't it be easier to remove the checks from
> >> _local_bh_enable(), and then just use rcu_read_lock_bh()?  Have those
> >> checks really been that helpful in finding bugs?  ;-)
> > 
> > You are right.  It would be much simpler to simply have it not
> > warn.
> 
> For now I'm going to assume that this is how the issue will be
> addressed.

And here is the patch, at long last.  Adding Ingo and Peter Z to CC
in case there is some problem with this approach that I cannot see.

							Thanx, Paul

commit 095d050d5d04344d3cdd4ff8558ea8709e3c4beb
Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Date:   Thu Sep 2 10:07:21 2010 -0700

    softirq: adjust error check
    
    The error check for _local_bh_enable_ip() warns on both in_irq() and
    irqs_disabled().  The check for in_irq() is necessary, because a hardirq
    might well have interrupted bh execution, in which case it is simply
    not possible for the hardirq to exclude the bh that got interrupted.
    
    However, it is perfectly reasonable to disable bh while hardirqs are
    disabled, and this in fact promotes common code.  This commit therefore
    removes the irqs_disabled() check.
    
    Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

diff --git a/kernel/softirq.c b/kernel/softirq.c
index 07b4f1b..3cff1bb 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -140,7 +140,7 @@ EXPORT_SYMBOL(_local_bh_enable);
 
 static inline void _local_bh_enable_ip(unsigned long ip)
 {
-	WARN_ON_ONCE(in_irq() || irqs_disabled());
+	WARN_ON_ONCE(in_irq());
 #ifdef CONFIG_TRACE_IRQFLAGS
 	local_irq_disable();
 #endif

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

* Re: [PATCH] netpoll: use non-BH variant of RCU
  2010-09-02 17:26                 ` Paul E. McKenney
@ 2010-09-03 15:34                   ` David Miller
  2010-09-03 15:52                     ` Paul E. McKenney
  0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2010-09-03 15:34 UTC (permalink / raw)
  To: paulmck; +Cc: herbert, linville, netdev, mingo, linux-kernel, peterz

From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Date: Thu, 2 Sep 2010 10:26:25 -0700

>     softirq: adjust error check
>     
>     The error check for _local_bh_enable_ip() warns on both in_irq() and
>     irqs_disabled().  The check for in_irq() is necessary, because a hardirq
>     might well have interrupted bh execution, in which case it is simply
>     not possible for the hardirq to exclude the bh that got interrupted.
>     
>     However, it is perfectly reasonable to disable bh while hardirqs are
>     disabled, and this in fact promotes common code.  This commit therefore
>     removes the irqs_disabled() check.
>     
>     Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

Acked-by: David S. Miller <davem@davemloft.net>

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

* Re: [PATCH] netpoll: use non-BH variant of RCU
  2010-09-03 15:34                   ` David Miller
@ 2010-09-03 15:52                     ` Paul E. McKenney
  0 siblings, 0 replies; 5+ messages in thread
From: Paul E. McKenney @ 2010-09-03 15:52 UTC (permalink / raw)
  To: David Miller; +Cc: herbert, linville, netdev, mingo, linux-kernel, peterz

On Fri, Sep 03, 2010 at 08:34:09AM -0700, David Miller wrote:
> From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> Date: Thu, 2 Sep 2010 10:26:25 -0700
> 
> >     softirq: adjust error check
> >     
> >     The error check for _local_bh_enable_ip() warns on both in_irq() and
> >     irqs_disabled().  The check for in_irq() is necessary, because a hardirq
> >     might well have interrupted bh execution, in which case it is simply
> >     not possible for the hardirq to exclude the bh that got interrupted.
> >     
> >     However, it is perfectly reasonable to disable bh while hardirqs are
> >     disabled, and this in fact promotes common code.  This commit therefore
> >     removes the irqs_disabled() check.
> >     
> >     Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> 
> Acked-by: David S. Miller <davem@davemloft.net>

Thank you, David!

							Thanx, Paul

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

end of thread, other threads:[~2010-09-03 15:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20100810211932.GG2379@linux.vnet.ibm.com>
     [not found] ` <20100810.163117.241919476.davem@davemloft.net>
     [not found]   ` <20100811220047.GH2516@linux.vnet.ibm.com>
     [not found]     ` <20100811.230936.183035599.davem@davemloft.net>
     [not found]       ` <20100812154213.GB2524@linux.vnet.ibm.com>
     [not found]         ` <20100813143904.GA27261@gondor.apana.org.au>
     [not found]           ` <20100813162912.GJ2511@linux.vnet.ibm.com>
2010-08-13 17:51             ` [PATCH] netpoll: use non-BH variant of RCU Herbert Xu
2010-08-15  6:50               ` David Miller
2010-09-02 17:26                 ` Paul E. McKenney
2010-09-03 15:34                   ` David Miller
2010-09-03 15:52                     ` 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