[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>
This commit is contained in:
committed by
David S. Miller
parent
075aa573b7
commit
11274e5a43
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user