| From e16f1d7efaa6c66bd3603c52059ae8ded55d2193 Mon Sep 17 00:00:00 2001 |
| From: Steven Rostedt <srostedt@redhat.com> |
| Date: Fri, 3 Jul 2009 08:44:28 -0500 |
| Subject: [PATCH] net: suppress warning of smp_processor_id use. |
| |
| commit 7e6a731d1e5896d498dd4f69b2920d66de9952ec in tip. |
| |
| John Kacur pointed out that the get_cpu_var used in net/sched/sch_generic.c |
| would trigger warnings. This was happing on a statistic variable and |
| by a softirq which is bound to a single thread. |
| |
| John sent a patch that used local_irq_save which is a little bit of |
| overkill. This version uses preempt disable, but we still need to create |
| a preempt_disable_rt API that is only activated when PREEMPT_RT is configured. |
| |
| Signed-off-by: Steven Rostedt <srostedt@redhat.com> |
| Signed-off-by: Ingo Molnar <mingo@elte.hu> |
| Signed-off-by: Thomas Gleixner <tglx@linutronix.de> |
| |
| diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c |
| index 0a18bbe..bf7f50e 100644 |
| --- a/net/sched/sch_generic.c |
| +++ b/net/sched/sch_generic.c |
| @@ -95,7 +95,9 @@ static inline int handle_dev_cpu_collision(struct sk_buff *skb, |
| * Another cpu is holding lock, requeue & delay xmits for |
| * some time. |
| */ |
| + preempt_disable(); /* FIXME: we need an _rt version of this */ |
| __get_cpu_var(netdev_rx_stat).cpu_collision++; |
| + preempt_enable(); |
| ret = dev_requeue_skb(skb, q); |
| } |
| |
| -- |
| 1.7.1.1 |
| |