net_sched: do not reprogram a timer about to expire
qdisc_watchdog_schedule_range_ns() can use the newly added slack and avoid rearming the hrtimer a bit earlier than the current value. This patch has no effect if delta_ns parameter is zero. Note that this means the max slack is potentially doubled. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
efe074c2cc
commit
b88948fbc7
@ -625,8 +625,13 @@ void qdisc_watchdog_schedule_range_ns(struct qdisc_watchdog *wd, u64 expires,
|
|||||||
&qdisc_root_sleeping(wd->qdisc)->state))
|
&qdisc_root_sleeping(wd->qdisc)->state))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (wd->last_expires == expires)
|
if (hrtimer_is_queued(&wd->timer)) {
|
||||||
return;
|
/* If timer is already set in [expires, expires + delta_ns],
|
||||||
|
* do not reprogram it.
|
||||||
|
*/
|
||||||
|
if (wd->last_expires - expires <= delta_ns)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
wd->last_expires = expires;
|
wd->last_expires = expires;
|
||||||
hrtimer_start_range_ns(&wd->timer,
|
hrtimer_start_range_ns(&wd->timer,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user