Prev: sched: remove AFFINE_WAKEUPS feature
Next: [PATCH] kbuild: Really don't clean bounds.h and asm-offsets.h
From: Américo Wang on 12 Mar 2010 04:10 On Fri, Mar 12, 2010 at 4:07 PM, David Miller <davem(a)davemloft.net> wrote: > From: Américo Wang <xiyou.wangcong(a)gmail.com> > Date: Fri, 12 Mar 2010 15:56:03 +0800 > >> Ok, after decoding the lockdep output, it looks like that >> netif_receive_skb() should call rcu_read_lock_bh() instead of rcu_read_lock()? >> But I don't know if all callers of netif_receive_skb() are in softirq context. > > Normally, netif_receive_skb() is invoked from softirq context. > > However, via netpoll it can be invoked essentially from any context. > > But, when this happens, the networking receive path makes amends such > that this works fine. That's what the netpoll_receive_skb() check in > netif_receive_skb() is for. That check makes it bail out early if the > call to netif_receive_skb() is via a netpoll invocation. > Oh, I see. This means we should call rcu_read_lock_bh() instead. If Paul has no objections, I will send a patch for this. Thanks much, David! -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Eric Dumazet on 12 Mar 2010 06:20 Le vendredi 12 mars 2010 à 16:59 +0800, Américo Wang a écrit : > On Fri, Mar 12, 2010 at 4:07 PM, David Miller <davem(a)davemloft.net> wrote: > > From: Américo Wang <xiyou.wangcong(a)gmail.com> > > Date: Fri, 12 Mar 2010 15:56:03 +0800 > > > >> Ok, after decoding the lockdep output, it looks like that > >> netif_receive_skb() should call rcu_read_lock_bh() instead of rcu_read_lock()? > >> But I don't know if all callers of netif_receive_skb() are in softirq context. > > > > Normally, netif_receive_skb() is invoked from softirq context. > > > > However, via netpoll it can be invoked essentially from any context. > > > > But, when this happens, the networking receive path makes amends such > > that this works fine. That's what the netpoll_receive_skb() check in > > netif_receive_skb() is for. That check makes it bail out early if the > > call to netif_receive_skb() is via a netpoll invocation. > > > > Oh, I see. This means we should call rcu_read_lock_bh() instead. > If Paul has no objections, I will send a patch for this. > Nope, its calling rcu_read_lock() from interrupt context and it should stay as is (we dont need to disable bh, this has a cpu cost) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Américo Wang on 12 Mar 2010 08:20 On Fri, Mar 12, 2010 at 7:11 PM, Eric Dumazet <eric.dumazet(a)gmail.com> wrote: > Le vendredi 12 mars 2010 à 16:59 +0800, Américo Wang a écrit : >> On Fri, Mar 12, 2010 at 4:07 PM, David Miller <davem(a)davemloft.net> wrote: >> > From: Américo Wang <xiyou.wangcong(a)gmail.com> >> > Date: Fri, 12 Mar 2010 15:56:03 +0800 >> > >> >> Ok, after decoding the lockdep output, it looks like that >> >> netif_receive_skb() should call rcu_read_lock_bh() instead of rcu_read_lock()? >> >> But I don't know if all callers of netif_receive_skb() are in softirq context. >> > >> > Normally, netif_receive_skb() is invoked from softirq context. >> > >> > However, via netpoll it can be invoked essentially from any context. >> > >> > But, when this happens, the networking receive path makes amends such >> > that this works fine. That's what the netpoll_receive_skb() check in >> > netif_receive_skb() is for. That check makes it bail out early if the >> > call to netif_receive_skb() is via a netpoll invocation. >> > >> >> Oh, I see. This means we should call rcu_read_lock_bh() instead. >> If Paul has no objections, I will send a patch for this. >> > > Nope, its calling rcu_read_lock() from interrupt context and it should > stay as is (we dont need to disable bh, this has a cpu cost) > Oh, but lockdep complains about rcu_read_lock(), it said rcu_read_lock() can't be used in softirq context. Am I missing something? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Eric Dumazet on 12 Mar 2010 08:40 Le vendredi 12 mars 2010 à 21:11 +0800, Américo Wang a écrit : > Oh, but lockdep complains about rcu_read_lock(), it said > rcu_read_lock() can't be used in softirq context. > > Am I missing something? Well, lockdep might be dumb, I dont know... I suggest you read rcu_read_lock_bh kernel doc : /** * rcu_read_lock_bh - mark the beginning of a softirq-only RCU critical section * * This is equivalent of rcu_read_lock(), but to be used when updates * are being done using call_rcu_bh(). Since call_rcu_bh() callbacks * consider completion of a softirq handler to be a quiescent state, * a process in RCU read-side critical section must be protected by * disabling softirqs. Read-side critical sections in interrupt context * can use just rcu_read_lock(). * */ Last sentence being perfect : Read-side critical sections in interrupt context can use just rcu_read_lock(). -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Paul E. McKenney on 12 Mar 2010 17:10 On Fri, Mar 12, 2010 at 09:11:02PM +0800, Am�rico Wang wrote: > On Fri, Mar 12, 2010 at 7:11 PM, Eric Dumazet <eric.dumazet(a)gmail.com> wrote: > > Le vendredi 12 mars 2010 � 16:59 +0800, Am�rico Wang a �crit : > >> On Fri, Mar 12, 2010 at 4:07 PM, David Miller <davem(a)davemloft.net> wrote: > >> > From: Am�rico Wang <xiyou.wangcong(a)gmail.com> > >> > Date: Fri, 12 Mar 2010 15:56:03 +0800 > >> > > >> >> Ok, after decoding the lockdep output, it looks like that > >> >> netif_receive_skb() should call rcu_read_lock_bh() instead of rcu_read_lock()? > >> >> But I don't know if all callers of netif_receive_skb() are in softirq context. > >> > > >> > Normally, netif_receive_skb() is invoked from softirq context. > >> > > >> > However, via netpoll it can be invoked essentially from any context. > >> > > >> > But, when this happens, the networking receive path makes amends such > >> > that this works fine. �That's what the netpoll_receive_skb() check in > >> > netif_receive_skb() is for. �That check makes it bail out early if the > >> > call to netif_receive_skb() is via a netpoll invocation. > >> > > >> > >> Oh, I see. This means we should call rcu_read_lock_bh() instead. > >> If Paul has no objections, I will send a patch for this. > >> > > > > Nope, its calling rcu_read_lock() from interrupt context and it should > > stay as is (we dont need to disable bh, this has a cpu cost) > > > > Oh, but lockdep complains about rcu_read_lock(), it said > rcu_read_lock() can't be used in softirq context. > > Am I missing something? Hmmm... It is supposed to be OK to use rcu_read_lock() in pretty much any context, even NMI. I will take a look. Thanx, Paul -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 4 Prev: sched: remove AFFINE_WAKEUPS feature Next: [PATCH] kbuild: Really don't clean bounds.h and asm-offsets.h |