aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_generic.c
diff options
context:
space:
mode:
authorEric Dumazet <dada1@cosmosbay.com>2007-11-14 04:44:41 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:53:58 -0500
commit20fea08b5fb639c4c175b5c74a2bb346c5c5bc2e (patch)
tree3ffa7e1e82051c6772fc2a01d561e4a5a29bb138 /net/sched/sch_generic.c
parent2a8cc6c89039e0530a3335954253b76ed0f9339a (diff)
[NET]: Move Qdisc_class_ops and Qdisc_ops in appropriate sections.
Qdisc_class_ops are const, and Qdisc_ops are mostly read. Using "const" and "__read_mostly" qualifiers helps to reduce false sharing. Signed-off-by: Eric Dumazet <dada1@cosmosbay.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_generic.c')
-rw-r--r--net/sched/sch_generic.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 84c048a54799..9be2f152455a 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -287,7 +287,7 @@ static int noop_requeue(struct sk_buff *skb, struct Qdisc* qdisc)
287 return NET_XMIT_CN; 287 return NET_XMIT_CN;
288} 288}
289 289
290struct Qdisc_ops noop_qdisc_ops = { 290struct Qdisc_ops noop_qdisc_ops __read_mostly = {
291 .id = "noop", 291 .id = "noop",
292 .priv_size = 0, 292 .priv_size = 0,
293 .enqueue = noop_enqueue, 293 .enqueue = noop_enqueue,
@@ -304,7 +304,7 @@ struct Qdisc noop_qdisc = {
304 .list = LIST_HEAD_INIT(noop_qdisc.list), 304 .list = LIST_HEAD_INIT(noop_qdisc.list),
305}; 305};
306 306
307static struct Qdisc_ops noqueue_qdisc_ops = { 307static struct Qdisc_ops noqueue_qdisc_ops __read_mostly = {
308 .id = "noqueue", 308 .id = "noqueue",
309 .priv_size = 0, 309 .priv_size = 0,
310 .enqueue = noop_enqueue, 310 .enqueue = noop_enqueue,
@@ -406,7 +406,7 @@ static int pfifo_fast_init(struct Qdisc *qdisc, struct rtattr *opt)
406 return 0; 406 return 0;
407} 407}
408 408
409static struct Qdisc_ops pfifo_fast_ops = { 409static struct Qdisc_ops pfifo_fast_ops __read_mostly = {
410 .id = "pfifo_fast", 410 .id = "pfifo_fast",
411 .priv_size = PFIFO_FAST_BANDS * sizeof(struct sk_buff_head), 411 .priv_size = PFIFO_FAST_BANDS * sizeof(struct sk_buff_head),
412 .enqueue = pfifo_fast_enqueue, 412 .enqueue = pfifo_fast_enqueue,
@@ -472,7 +472,7 @@ errout:
472 472
473void qdisc_reset(struct Qdisc *qdisc) 473void qdisc_reset(struct Qdisc *qdisc)
474{ 474{
475 struct Qdisc_ops *ops = qdisc->ops; 475 const struct Qdisc_ops *ops = qdisc->ops;
476 476
477 if (ops->reset) 477 if (ops->reset)
478 ops->reset(qdisc); 478 ops->reset(qdisc);
@@ -491,7 +491,7 @@ static void __qdisc_destroy(struct rcu_head *head)
491 491
492void qdisc_destroy(struct Qdisc *qdisc) 492void qdisc_destroy(struct Qdisc *qdisc)
493{ 493{
494 struct Qdisc_ops *ops = qdisc->ops; 494 const struct Qdisc_ops *ops = qdisc->ops;
495 495
496 if (qdisc->flags & TCQ_F_BUILTIN || 496 if (qdisc->flags & TCQ_F_BUILTIN ||
497 !atomic_dec_and_test(&qdisc->refcnt)) 497 !atomic_dec_and_test(&qdisc->refcnt))