aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_api.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2014-10-04 13:11:31 -0400
committerDavid S. Miller <davem@davemloft.net>2014-10-06 00:55:10 -0400
commitf2600cf02b5b59aaee082c3485b7f01fc7f7b70c (patch)
treef38d692c3f706ead3d0cfd77b216fbd629a22964 /net/sched/sch_api.c
parent681d2421e1135b95f5cd9d16fe10eac7f570a9f2 (diff)
net: sched: avoid costly atomic operation in fq_dequeue()
Standard qdisc API to setup a timer implies an atomic operation on every packet dequeue : qdisc_unthrottled() It turns out this is not really needed for FQ, as FQ has no concept of global qdisc throttling, being a qdisc handling many different flows, some of them can be throttled, while others are not. Fix is straightforward : add a 'bool throttle' to qdisc_watchdog_schedule_ns(), and remove calls to qdisc_unthrottled() in sch_fq. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_api.c')
-rw-r--r--net/sched/sch_api.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index c79a226cc25c..2cf61b3e633c 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -594,13 +594,14 @@ void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc)
594} 594}
595EXPORT_SYMBOL(qdisc_watchdog_init); 595EXPORT_SYMBOL(qdisc_watchdog_init);
596 596
597void qdisc_watchdog_schedule_ns(struct qdisc_watchdog *wd, u64 expires) 597void qdisc_watchdog_schedule_ns(struct qdisc_watchdog *wd, u64 expires, bool throttle)
598{ 598{
599 if (test_bit(__QDISC_STATE_DEACTIVATED, 599 if (test_bit(__QDISC_STATE_DEACTIVATED,
600 &qdisc_root_sleeping(wd->qdisc)->state)) 600 &qdisc_root_sleeping(wd->qdisc)->state))
601 return; 601 return;
602 602
603 qdisc_throttled(wd->qdisc); 603 if (throttle)
604 qdisc_throttled(wd->qdisc);
604 605
605 hrtimer_start(&wd->timer, 606 hrtimer_start(&wd->timer,
606 ns_to_ktime(expires), 607 ns_to_ktime(expires),