Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 255961
b: refs/heads/master
c: d5b8aa1
h: refs/heads/master
i:
  255959: 7b92190
v: v3
  • Loading branch information
jamal authored and David S. Miller committed Jun 27, 2011
1 parent 71160a2 commit bcf328e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 85a43a9edaf5b541381acbf4061bace1121d6ef0
refs/heads/master: d5b8aa1d246fddfe4042be6f6eb169efa5cfbb94
12 changes: 7 additions & 5 deletions trunk/net/sched/sch_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,17 @@ static inline int qdisc_restart(struct Qdisc *q)

void __qdisc_run(struct Qdisc *q)
{
unsigned long start_time = jiffies;
int quota = weight_p;
int work = 0;

while (qdisc_restart(q)) {
work++;
/*
* 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 (work >= quota || need_resched()) {
__netif_schedule(q);
break;
}
Expand Down

0 comments on commit bcf328e

Please sign in to comment.