summaryrefslogtreecommitdiffstats
path: root/net/sched
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2007-03-22 20:18:35 +0100
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 07:27:23 +0200
commit1936502d00ae6c2aa3931c42f6cf54afaba094f2 (patch)
tree2870f51b8b5a91c39295fe092dd042b774825bf4 /net/sched
parent[NETEM]: avoid excessive requeues (diff)
downloadlinux-1936502d00ae6c2aa3931c42f6cf54afaba094f2.tar.xz
linux-1936502d00ae6c2aa3931c42f6cf54afaba094f2.zip
[NET_SCHED] qdisc: avoid transmit softirq on watchdog wakeup
If possible, avoid having to do a transmit softirq when a qdisc watchdog decides to re-enable. The watchdog routine runs off a timer, so it is already in the same effective context as the softirq. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/sch_api.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index fcaa4adefc82..58732509160d 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -296,10 +296,16 @@ static enum hrtimer_restart qdisc_watchdog(struct hrtimer *timer)
{
struct qdisc_watchdog *wd = container_of(timer, struct qdisc_watchdog,
timer);
+ struct net_device *dev = wd->qdisc->dev;
wd->qdisc->flags &= ~TCQ_F_THROTTLED;
smp_wmb();
- netif_schedule(wd->qdisc->dev);
+ if (spin_trylock(&dev->queue_lock)) {
+ qdisc_run(dev);
+ spin_unlock(&dev->queue_lock);
+ } else
+ netif_schedule(dev);
+
return HRTIMER_NORESTART;
}