From: Changli Gao Date: Sun, 8 Aug 2010 03:35:43 +0000 (-0700) Subject: net: disable preemption before call smp_processor_id() X-Git-Tag: v2.6.36-rc1~43^2~32 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cece1945bffcf1a823cdfa36669beae118419351;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git net: disable preemption before call smp_processor_id() Although netif_rx() isn't expected to be called in process context with preemption enabled, it'd better handle this case. And this is why get_cpu() is used in the non-RPS #ifdef branch. If tree RCU is selected, rcu_read_lock() won't disable preemption, so preempt_disable() should be called explictly. Signed-off-by: Changli Gao Signed-off-by: David S. Miller --- diff --git a/net/core/dev.c b/net/core/dev.c index 2b50896..1ae6543 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -2517,6 +2517,7 @@ int netif_rx(struct sk_buff *skb) struct rps_dev_flow voidflow, *rflow = &voidflow; int cpu; + preempt_disable(); rcu_read_lock(); cpu = get_rps_cpu(skb->dev, skb, &rflow); @@ -2526,6 +2527,7 @@ int netif_rx(struct sk_buff *skb) ret = enqueue_to_backlog(skb, cpu, &rflow->last_qtail); rcu_read_unlock(); + preempt_enable(); } #else {