aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_cbq.c
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2011-01-20 00:27:16 -0500
committerDavid S. Miller <davem@davemloft.net>2011-01-20 19:59:32 -0500
commitfd245a4adb5288eac37250875f237c40a20a1944 (patch)
tree1c16670c53dab9d9d05b26a7e7ae8a6a8267e847 /net/sched/sch_cbq.c
parent817fb15dfd988d8dda916ee04fa506f0c466b9d6 (diff)
net_sched: move TCQ_F_THROTTLED flag
In commit 371121057607e (net: QDISC_STATE_RUNNING dont need atomic bit ops) I moved QDISC_STATE_RUNNING flag to __state container, located in the cache line containing qdisc lock and often dirtied fields. I now move TCQ_F_THROTTLED bit too, so that we let first cache line read mostly, and shared by all cpus. This should speedup HTB/CBQ for example. Not using test_bit()/__clear_bit()/__test_and_set_bit allows to use an "unsigned int" for __state container, reducing by 8 bytes Qdisc size. Introduce helpers to hide implementation details. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> CC: Patrick McHardy <kaber@trash.net> CC: Jesper Dangaard Brouer <hawk@diku.dk> CC: Jarek Poplawski <jarkao2@gmail.com> CC: Jamal Hadi Salim <hadi@cyberus.ca> CC: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_cbq.c')
-rw-r--r--net/sched/sch_cbq.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
index 4aaf44c95c52..25ed522b2891 100644
--- a/net/sched/sch_cbq.c
+++ b/net/sched/sch_cbq.c
@@ -351,7 +351,7 @@ cbq_mark_toplevel(struct cbq_sched_data *q, struct cbq_class *cl)
351{ 351{
352 int toplevel = q->toplevel; 352 int toplevel = q->toplevel;
353 353
354 if (toplevel > cl->level && !(cl->q->flags & TCQ_F_THROTTLED)) { 354 if (toplevel > cl->level && !(qdisc_is_throttled(cl->q))) {
355 psched_time_t now; 355 psched_time_t now;
356 psched_tdiff_t incr; 356 psched_tdiff_t incr;
357 357
@@ -625,7 +625,7 @@ static enum hrtimer_restart cbq_undelay(struct hrtimer *timer)
625 hrtimer_start(&q->delay_timer, time, HRTIMER_MODE_ABS); 625 hrtimer_start(&q->delay_timer, time, HRTIMER_MODE_ABS);
626 } 626 }
627 627
628 sch->flags &= ~TCQ_F_THROTTLED; 628 qdisc_unthrottled(sch);
629 __netif_schedule(qdisc_root(sch)); 629 __netif_schedule(qdisc_root(sch));
630 return HRTIMER_NORESTART; 630 return HRTIMER_NORESTART;
631} 631}
@@ -974,7 +974,7 @@ cbq_dequeue(struct Qdisc *sch)
974 skb = cbq_dequeue_1(sch); 974 skb = cbq_dequeue_1(sch);
975 if (skb) { 975 if (skb) {
976 sch->q.qlen--; 976 sch->q.qlen--;
977 sch->flags &= ~TCQ_F_THROTTLED; 977 qdisc_unthrottled(sch);
978 return skb; 978 return skb;
979 } 979 }
980 980