diff options
author | Stephen Hemminger <shemminger@linux-foundation.org> | 2007-03-22 15:17:42 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:27:22 -0400 |
commit | 11274e5a43266d531140530adebead6903380caf (patch) | |
tree | 38c365a3835c9e5973fb1941a31dde8cc4856724 /net/sched/sch_api.c | |
parent | 075aa573b74a732aeff487ab77d3fbd627c10856 (diff) |
[NETEM]: avoid excessive requeues
The netem code would call getnstimeofday() and dequeue/requeue after
every packet, even if it was waiting. Avoid this overhead by using
the throttled flag.
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_api.c')
-rw-r--r-- | net/sched/sch_api.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index b06f20294ac0..fcaa4adefc82 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c | |||
@@ -298,6 +298,7 @@ static enum hrtimer_restart qdisc_watchdog(struct hrtimer *timer) | |||
298 | timer); | 298 | timer); |
299 | 299 | ||
300 | wd->qdisc->flags &= ~TCQ_F_THROTTLED; | 300 | wd->qdisc->flags &= ~TCQ_F_THROTTLED; |
301 | smp_wmb(); | ||
301 | netif_schedule(wd->qdisc->dev); | 302 | netif_schedule(wd->qdisc->dev); |
302 | return HRTIMER_NORESTART; | 303 | return HRTIMER_NORESTART; |
303 | } | 304 | } |
@@ -315,6 +316,7 @@ void qdisc_watchdog_schedule(struct qdisc_watchdog *wd, psched_time_t expires) | |||
315 | ktime_t time; | 316 | ktime_t time; |
316 | 317 | ||
317 | wd->qdisc->flags |= TCQ_F_THROTTLED; | 318 | wd->qdisc->flags |= TCQ_F_THROTTLED; |
319 | smp_wmb(); | ||
318 | time = ktime_set(0, 0); | 320 | time = ktime_set(0, 0); |
319 | time = ktime_add_ns(time, PSCHED_US2NS(expires)); | 321 | time = ktime_add_ns(time, PSCHED_US2NS(expires)); |
320 | hrtimer_start(&wd->timer, time, HRTIMER_MODE_ABS); | 322 | hrtimer_start(&wd->timer, time, HRTIMER_MODE_ABS); |
@@ -325,6 +327,7 @@ void qdisc_watchdog_cancel(struct qdisc_watchdog *wd) | |||
325 | { | 327 | { |
326 | hrtimer_cancel(&wd->timer); | 328 | hrtimer_cancel(&wd->timer); |
327 | wd->qdisc->flags &= ~TCQ_F_THROTTLED; | 329 | wd->qdisc->flags &= ~TCQ_F_THROTTLED; |
330 | smp_wmb(); | ||
328 | } | 331 | } |
329 | EXPORT_SYMBOL(qdisc_watchdog_cancel); | 332 | EXPORT_SYMBOL(qdisc_watchdog_cancel); |
330 | 333 | ||