diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/sched/sch_generic.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index 10b5c0887fff..b741618e4d54 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c | |||
@@ -184,10 +184,22 @@ static inline int qdisc_restart(struct net_device *dev) | |||
184 | 184 | ||
185 | void __qdisc_run(struct net_device *dev) | 185 | void __qdisc_run(struct net_device *dev) |
186 | { | 186 | { |
187 | do { | 187 | unsigned long start_time = jiffies; |
188 | if (!qdisc_restart(dev)) | 188 | |
189 | while (qdisc_restart(dev)) { | ||
190 | if (netif_queue_stopped(dev)) | ||
191 | break; | ||
192 | |||
193 | /* | ||
194 | * Postpone processing if | ||
195 | * 1. another process needs the CPU; | ||
196 | * 2. we've been doing it for too long. | ||
197 | */ | ||
198 | if (need_resched() || jiffies != start_time) { | ||
199 | netif_schedule(dev); | ||
189 | break; | 200 | break; |
190 | } while (!netif_queue_stopped(dev)); | 201 | } |
202 | } | ||
191 | 203 | ||
192 | clear_bit(__LINK_STATE_QDISC_RUNNING, &dev->state); | 204 | clear_bit(__LINK_STATE_QDISC_RUNNING, &dev->state); |
193 | } | 205 | } |