Message ID | 20100616033336.GA17440@gondor.apana.org.au |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
From: Herbert Xu <herbert@gondor.apana.org.au> Date: Wed, 16 Jun 2010 13:33:36 +1000 > On Wed, Jun 16, 2010 at 05:03:20AM +0200, Eric Dumazet wrote: >> >> I wonder how these patches were tested, Herbert ? > > You know, not everyone enables RCU debugging... Even though I'm as guilty as you, I have to agree with Eric that especially us core folks should be running with the various lock debugging options on all the time. Maybe someone should add the RCU debugging config option to Documentation/SubmitChecklist :-) > Anyway, this patch should fix the problems you've spotted. > netpoll: Use correct primitives for RCU dereferencing > > Now that RCU debugging checks for matching rcu_dereference calls > and rcu_read_lock, we need to use the correct primitives or face > nasty warnings. > > Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Applied, thanks guys! -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Le mercredi 16 juin 2010 à 13:33 +1000, Herbert Xu a écrit : > On Wed, Jun 16, 2010 at 05:03:20AM +0200, Eric Dumazet wrote: > > > > I wonder how these patches were tested, Herbert ? > > You know, not everyone enables RCU debugging... > Hmm, this was not an attack Herbert, just a suggestion, I now turn on RCU lockdep debugging when doing RCU changes, it can helps ;) > Anyway, this patch should fix the problems you've spotted. > Thanks -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index 4c77fe7..413742c 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h @@ -64,7 +64,7 @@ static inline bool netpoll_rx(struct sk_buff *skb) bool ret = false; rcu_read_lock_bh(); - npinfo = rcu_dereference(skb->dev->npinfo); + npinfo = rcu_dereference_bh(skb->dev->npinfo); if (!npinfo || (list_empty(&npinfo->rx_np) && !npinfo->rx_flags)) goto out; @@ -82,7 +82,7 @@ out: static inline int netpoll_rx_on(struct sk_buff *skb) { - struct netpoll_info *npinfo = rcu_dereference(skb->dev->npinfo); + struct netpoll_info *npinfo = rcu_dereference_bh(skb->dev->npinfo); return npinfo && (!list_empty(&npinfo->rx_np) || npinfo->rx_flags); }