diff options
author | Eric Dumazet <edumazet@google.com> | 2014-10-04 13:11:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-10-06 00:55:10 -0400 |
commit | f2600cf02b5b59aaee082c3485b7f01fc7f7b70c (patch) | |
tree | f38d692c3f706ead3d0cfd77b216fbd629a22964 /net/sched/sch_fq.c | |
parent | 681d2421e1135b95f5cd9d16fe10eac7f570a9f2 (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_fq.c')
-rw-r--r-- | net/sched/sch_fq.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/sched/sch_fq.c b/net/sched/sch_fq.c index c9b9fcb53206..cbd7e1fd23b4 100644 --- a/net/sched/sch_fq.c +++ b/net/sched/sch_fq.c | |||
@@ -377,7 +377,6 @@ static int fq_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
377 | if (time_after(jiffies, f->age + q->flow_refill_delay)) | 377 | if (time_after(jiffies, f->age + q->flow_refill_delay)) |
378 | f->credit = max_t(u32, f->credit, q->quantum); | 378 | f->credit = max_t(u32, f->credit, q->quantum); |
379 | q->inactive_flows--; | 379 | q->inactive_flows--; |
380 | qdisc_unthrottled(sch); | ||
381 | } | 380 | } |
382 | 381 | ||
383 | /* Note: this overwrites f->age */ | 382 | /* Note: this overwrites f->age */ |
@@ -385,7 +384,6 @@ static int fq_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
385 | 384 | ||
386 | if (unlikely(f == &q->internal)) { | 385 | if (unlikely(f == &q->internal)) { |
387 | q->stat_internal_packets++; | 386 | q->stat_internal_packets++; |
388 | qdisc_unthrottled(sch); | ||
389 | } | 387 | } |
390 | sch->q.qlen++; | 388 | sch->q.qlen++; |
391 | 389 | ||
@@ -433,7 +431,8 @@ begin: | |||
433 | if (!head->first) { | 431 | if (!head->first) { |
434 | if (q->time_next_delayed_flow != ~0ULL) | 432 | if (q->time_next_delayed_flow != ~0ULL) |
435 | qdisc_watchdog_schedule_ns(&q->watchdog, | 433 | qdisc_watchdog_schedule_ns(&q->watchdog, |
436 | q->time_next_delayed_flow); | 434 | q->time_next_delayed_flow, |
435 | false); | ||
437 | return NULL; | 436 | return NULL; |
438 | } | 437 | } |
439 | } | 438 | } |
@@ -495,7 +494,6 @@ begin: | |||
495 | } | 494 | } |
496 | out: | 495 | out: |
497 | qdisc_bstats_update(sch, skb); | 496 | qdisc_bstats_update(sch, skb); |
498 | qdisc_unthrottled(sch); | ||
499 | return skb; | 497 | return skb; |
500 | } | 498 | } |
501 | 499 | ||