summaryrefslogtreecommitdiff
path: root/net/sched/sch_api.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2007-03-22 19:17:42 (GMT)
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 05:27:22 (GMT)
commit11274e5a43266d531140530adebead6903380caf (patch)
tree38c365a3835c9e5973fb1941a31dde8cc4856724 /net/sched/sch_api.c
parent075aa573b74a732aeff487ab77d3fbd627c10856 (diff)
downloadlinux-fsl-qoriq-11274e5a43266d531140530adebead6903380caf.tar.xz
[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.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index b06f202..fcaa4ad 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)
timer);
wd->qdisc->flags &= ~TCQ_F_THROTTLED;
+ smp_wmb();
netif_schedule(wd->qdisc->dev);
return HRTIMER_NORESTART;
}
@@ -315,6 +316,7 @@ void qdisc_watchdog_schedule(struct qdisc_watchdog *wd, psched_time_t expires)
ktime_t time;
wd->qdisc->flags |= TCQ_F_THROTTLED;
+ smp_wmb();
time = ktime_set(0, 0);
time = ktime_add_ns(time, PSCHED_US2NS(expires));
hrtimer_start(&wd->timer, time, HRTIMER_MODE_ABS);
@@ -325,6 +327,7 @@ void qdisc_watchdog_cancel(struct qdisc_watchdog *wd)
{
hrtimer_cancel(&wd->timer);
wd->qdisc->flags &= ~TCQ_F_THROTTLED;
+ smp_wmb();
}
EXPORT_SYMBOL(qdisc_watchdog_cancel);