Message ID | 1309097862.5134.26.camel@mojatatu |
---|---|
State | Superseded, archived |
Delegated to: | David Miller |
Headers | show |
On Sun, 2011-06-26 at 10:17 -0400, jamal wrote: [...] > diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c > index b4c6809..578269e 100644 > --- a/net/sched/sch_generic.c > +++ b/net/sched/sch_generic.c > @@ -190,14 +190,18 @@ static inline int qdisc_restart(struct Qdisc *q) > void __qdisc_run(struct Qdisc *q) > { > unsigned long start_time = jiffies; > + int quota = 0; > + int work = weight_p; These variable names seem to be the wrong way round, i.e. the weight is our 'quota' and the number of packets dequeued is the 'work' we've done. Ben. > while (qdisc_restart(q)) { > + quota++; > /* > - * 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; > + * 3. we've been doing it for too long. > */ > - if (need_resched() || jiffies != start_time) { > + if (quota >= work || need_resched() || jiffies != start_time) { > __netif_schedule(q); > break; > } >
On Sun, 2011-06-26 at 15:53 +0100, Ben Hutchings wrote: > These variable names seem to be the wrong way round, i.e. the weight is > our 'quota' and the number of packets dequeued is the 'work' we've done. Makes sense - I will make the change. cheers, jamal -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index b4c6809..578269e 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c @@ -190,14 +190,18 @@ static inline int qdisc_restart(struct Qdisc *q) void __qdisc_run(struct Qdisc *q) { unsigned long start_time = jiffies; + int quota = 0; + int work = weight_p; while (qdisc_restart(q)) { + quota++; /* - * 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; + * 3. we've been doing it for too long. */ - if (need_resched() || jiffies != start_time) { + if (quota >= work || need_resched() || jiffies != start_time) { __netif_schedule(q); break; }