linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][UPSTREAM]net,RT:Remove preemption disabling in netif_rx()
@ 2012-05-17  4:05 Priyanka Jain
  2012-05-24  4:28 ` Jain Priyanka-B32167
  0 siblings, 1 reply; 7+ messages in thread
From: Priyanka Jain @ 2012-05-17  4:05 UTC (permalink / raw)
  To: linux-rt-users; +Cc: tglx, rostedt, Rajan.Srivastava, Priyanka Jain

1)enqueue_to_backlog() (called from netif_rx) should be
  bind to a particluar CPU. This can be achieved by
  disabling migration. No need to disable preemption

2)Fixes crash "BUG: scheduling while atomic: ksoftirqd"
  in case of RT.
  If preemption is disabled, enqueue_to_backog() is called
  in atomic context. And if backlog exceeds its count,
  kfree_skb() is called. But in RT, kfree_skb() might
  gets scheduled out, so it expects non atomic context.

3)When CONFIG_PREEMPT_RT_FULL is not defined,
 migrate_enable(), migrate_disable() maps to
 preempt_enable() and preempt_disable(), so no
 change in functionality in case of non-RT.

-Replace preempt_enable(), preempt_disable() with
 migrate_enable(), migrate_disable() respectively
-Replace get_cpu(), put_cpu() with get_cpu_light(),
 put_cpu_light() respectively

Signed-off-by: Priyanka Jain <Priyanka.Jain@freescale.com>
Acked-by: Rajan Srivastava <Rajan.Srivastava@freescale.com>
---
 Testing: Tested successfully on p4080ds(8-core SMP system)  

 net/core/dev.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 452db70..4017820 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2940,7 +2940,7 @@ int netif_rx(struct sk_buff *skb)
 		struct rps_dev_flow voidflow, *rflow = &voidflow;
 		int cpu;
 
-		preempt_disable();
+		migrate_disable();
 		rcu_read_lock();
 
 		cpu = get_rps_cpu(skb->dev, skb, &rflow);
@@ -2950,13 +2950,13 @@ int netif_rx(struct sk_buff *skb)
 		ret = enqueue_to_backlog(skb, cpu, &rflow->last_qtail);
 
 		rcu_read_unlock();
-		preempt_enable();
+		migrate_enable();
 	} else
 #endif
 	{
 		unsigned int qtail;
-		ret = enqueue_to_backlog(skb, get_cpu(), &qtail);
-		put_cpu();
+		ret = enqueue_to_backlog(skb, get_cpu_light(), &qtail);
+		put_cpu_light();
 	}
 	return ret;
 }
-- 
1.7.4.1




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

end of thread, other threads:[~2012-06-05  9:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-17  4:05 [PATCH][UPSTREAM]net,RT:Remove preemption disabling in netif_rx() Priyanka Jain
2012-05-24  4:28 ` Jain Priyanka-B32167
2012-05-24 13:17   ` Steven Rostedt
2012-05-25 22:31     ` Thomas Gleixner
2012-05-25 22:43       ` Steven Rostedt
2012-05-29  7:59         ` Peter Zijlstra
2012-06-05  9:04           ` Jain Priyanka-B32167

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).