summaryrefslogtreecommitdiffstats
path: root/net/sched
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-07-16 11:36:04 +0200
committerDavid S. Miller <davem@davemloft.net>2008-07-18 04:21:23 +0200
commit17715e62a5e5c7224e5f906a4b8f9e5084100118 (patch)
tree83958bfcb21886df0a827614482acbbcc3a453f9 /net/sched
parentpkt_sched: Perform bulk of qdisc destruction in RCU. (diff)
downloadlinux-17715e62a5e5c7224e5f906a4b8f9e5084100118.tar.xz
linux-17715e62a5e5c7224e5f906a4b8f9e5084100118.zip
pkt_sched: Use per-queue locking in shutdown_scheduler_queue.
This eliminates another qdisc_lock_tree user. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/sch_generic.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 082db8abe703..efa418a1b34e 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -757,18 +757,20 @@ static void shutdown_scheduler_queue(struct net_device *dev,
struct Qdisc *qdisc_default = _qdisc_default;
if (qdisc) {
+ spinlock_t *root_lock = qdisc_root_lock(qdisc);
+
dev_queue->qdisc = qdisc_default;
dev_queue->qdisc_sleeping = qdisc_default;
+ spin_lock(root_lock);
qdisc_destroy(qdisc);
+ spin_unlock(root_lock);
}
}
void dev_shutdown(struct net_device *dev)
{
- qdisc_lock_tree(dev);
netdev_for_each_tx_queue(dev, shutdown_scheduler_queue, &noop_qdisc);
shutdown_scheduler_queue(dev, &dev->rx_queue, NULL);
BUG_TRAP(!timer_pending(&dev->watchdog_timer));
- qdisc_unlock_tree(dev);
}