1 From 03adb68ec774b87afff9f7f37289872ee5ddd9d7 Mon Sep 17 00:00:00 2001
2 From: Priyanka Jain <Priyanka.Jain@freescale.com>
3 Date: Thu, 17 May 2012 09:35:11 +0530
4 Subject: [PATCH 226/366] net: Remove preemption disabling in netif_rx()
6 1)enqueue_to_backlog() (called from netif_rx) should be
7 bind to a particluar CPU. This can be achieved by
8 disabling migration. No need to disable preemption
10 2)Fixes crash "BUG: scheduling while atomic: ksoftirqd"
12 If preemption is disabled, enqueue_to_backog() is called
13 in atomic context. And if backlog exceeds its count,
14 kfree_skb() is called. But in RT, kfree_skb() might
15 gets scheduled out, so it expects non atomic context.
17 3)When CONFIG_PREEMPT_RT_FULL is not defined,
18 migrate_enable(), migrate_disable() maps to
19 preempt_enable() and preempt_disable(), so no
20 change in functionality in case of non-RT.
22 -Replace preempt_enable(), preempt_disable() with
23 migrate_enable(), migrate_disable() respectively
24 -Replace get_cpu(), put_cpu() with get_cpu_light(),
25 put_cpu_light() respectively
27 Signed-off-by: Priyanka Jain <Priyanka.Jain@freescale.com>
28 Acked-by: Rajan Srivastava <Rajan.Srivastava@freescale.com>
29 Cc: <rostedt@goodmis.orgn>
30 Link: http://lkml.kernel.org/r/1337227511-2271-1-git-send-email-Priyanka.Jain@freescale.com
32 Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
34 net/core/dev.c | 8 ++++----
35 1 file changed, 4 insertions(+), 4 deletions(-)
37 diff --git a/net/core/dev.c b/net/core/dev.c
38 index 12b76f9..437e5fe 100644
41 @@ -3546,7 +3546,7 @@ static int netif_rx_internal(struct sk_buff *skb)
42 struct rps_dev_flow voidflow, *rflow = &voidflow;
49 cpu = get_rps_cpu(skb->dev, skb, &rflow);
50 @@ -3556,13 +3556,13 @@ static int netif_rx_internal(struct sk_buff *skb)
51 ret = enqueue_to_backlog(skb, cpu, &rflow->last_qtail);
60 - ret = enqueue_to_backlog(skb, get_cpu(), &qtail);
62 + ret = enqueue_to_backlog(skb, get_cpu_light(), &qtail);