]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - net/sched/sch_generic.c
Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux.git] / net / sched / sch_generic.c
index 8769b4b8807d9d6638619059230462750bdff2ee..5ab696efca951313372c3dfda0c2da52e97f4975 100644 (file)
@@ -382,13 +382,8 @@ void __qdisc_run(struct Qdisc *q)
        int packets;
 
        while (qdisc_restart(q, &packets)) {
-               /*
-                * Ordered by possible occurrence: Postpone processing if
-                * 1. we've exceeded packet quota
-                * 2. another process needs the CPU;
-                */
                quota -= packets;
-               if (quota <= 0 || need_resched()) {
+               if (quota <= 0) {
                        __netif_schedule(q);
                        break;
                }
@@ -657,7 +652,7 @@ static struct sk_buff *pfifo_fast_dequeue(struct Qdisc *qdisc)
        if (likely(skb)) {
                qdisc_update_stats_at_dequeue(qdisc, skb);
        } else {
-               qdisc->empty = true;
+               WRITE_ONCE(qdisc->empty, true);
        }
 
        return skb;
@@ -1214,8 +1209,13 @@ void dev_deactivate_many(struct list_head *head)
 
        /* Wait for outstanding qdisc_run calls. */
        list_for_each_entry(dev, head, close_list) {
-               while (some_qdisc_is_busy(dev))
-                       yield();
+               while (some_qdisc_is_busy(dev)) {
+                       /* wait_event() would avoid this sleep-loop but would
+                        * require expensive checks in the fast paths of packet
+                        * processing which isn't worth it.
+                        */
+                       schedule_timeout_uninterruptible(1);
+               }
                /* The new qdisc is assigned at this point so we can safely
                 * unwind stale skb lists and qdisc statistics
                 */