aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_generic.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-07-16 05:36:04 -0400
committerDavid S. Miller <davem@davemloft.net>2008-07-17 22:21:23 -0400
commit17715e62a5e5c7224e5f906a4b8f9e5084100118 (patch)
tree83958bfcb21886df0a827614482acbbcc3a453f9 /net/sched/sch_generic.c
parent8a34c5dc3a7c6431f1cd94c0904be81b296e08ca (diff)
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/sch_generic.c')
-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,
757 struct Qdisc *qdisc_default = _qdisc_default; 757 struct Qdisc *qdisc_default = _qdisc_default;
758 758
759 if (qdisc) { 759 if (qdisc) {
760 spinlock_t *root_lock = qdisc_root_lock(qdisc);
761
760 dev_queue->qdisc = qdisc_default; 762 dev_queue->qdisc = qdisc_default;
761 dev_queue->qdisc_sleeping = qdisc_default; 763 dev_queue->qdisc_sleeping = qdisc_default;
762 764
765 spin_lock(root_lock);
763 qdisc_destroy(qdisc); 766 qdisc_destroy(qdisc);
767 spin_unlock(root_lock);
764 } 768 }
765} 769}
766 770
767void dev_shutdown(struct net_device *dev) 771void dev_shutdown(struct net_device *dev)
768{ 772{
769 qdisc_lock_tree(dev);
770 netdev_for_each_tx_queue(dev, shutdown_scheduler_queue, &noop_qdisc); 773 netdev_for_each_tx_queue(dev, shutdown_scheduler_queue, &noop_qdisc);
771 shutdown_scheduler_queue(dev, &dev->rx_queue, NULL); 774 shutdown_scheduler_queue(dev, &dev->rx_queue, NULL);
772 BUG_TRAP(!timer_pending(&dev->watchdog_timer)); 775 BUG_TRAP(!timer_pending(&dev->watchdog_timer));
773 qdisc_unlock_tree(dev);
774} 776}