Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
[pandora-kernel.git] / net / sched / sch_generic.c
index b4c6809..69fca27 100644 (file)
@@ -189,15 +189,15 @@ static inline int qdisc_restart(struct Qdisc *q)
 
 void __qdisc_run(struct Qdisc *q)
 {
-       unsigned long start_time = jiffies;
+       int quota = weight_p;
 
        while (qdisc_restart(q)) {
                /*
-                * Postpone processing if
-                * 1. another process needs the CPU;
-                * 2. we've been doing it for too long.
+                * Ordered by possible occurrence: Postpone processing if
+                * 1. we've exceeded packet quota
+                * 2. another process needs the CPU;
                 */
-               if (need_resched() || jiffies != start_time) {
+               if (--quota <= 0 || need_resched()) {
                        __netif_schedule(q);
                        break;
                }