aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/sched/sch_generic.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index b4c680900d7a..d253c16a314c 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -189,15 +189,17 @@ static inline int qdisc_restart(struct Qdisc *q)
189 189
190void __qdisc_run(struct Qdisc *q) 190void __qdisc_run(struct Qdisc *q)
191{ 191{
192 unsigned long start_time = jiffies; 192 int quota = weight_p;
193 int work = 0;
193 194
194 while (qdisc_restart(q)) { 195 while (qdisc_restart(q)) {
196 work++;
195 /* 197 /*
196 * Postpone processing if 198 * Ordered by possible occurrence: Postpone processing if
197 * 1. another process needs the CPU; 199 * 1. we've exceeded packet quota
198 * 2. we've been doing it for too long. 200 * 2. another process needs the CPU;
199 */ 201 */
200 if (need_resched() || jiffies != start_time) { 202 if (work >= quota || need_resched()) {
201 __netif_schedule(q); 203 __netif_schedule(q);
202 break; 204 break;
203 } 205 }