net_sched: gen_estimator: complete rewrite of rate estimators
1) Old code was hard to maintain, due to complex lock chains. (We probably will be able to remove some kfree_rcu() in callers) 2) Using a single timer to update all estimators does not scale. 3) Code was buggy on 32bit kernel (WRITE_ONCE() on 64bit quantity is not supposed to work well) In this rewrite : - I removed the RB tree that had to be scanned in gen_estimator_active(). qdisc dumps should be much faster. - Each estimator has its own timer. - Estimations are maintained in net_rate_estimator structure, instead of dirtying the qdisc. Minor, but part of the simplification. - Reading the estimator uses RCU and a seqcount to provide proper support for 32bit kernels. - We reduce memory need when estimators are not used, since we store a pointer, instead of the bytes/packets counters. - xt_rateest_mt() no longer has to grab a spinlock. (In the future, xt_rateest_tg() could be switched to per cpu counters) Signed-off-by:Eric Dumazet <edumazet@google.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
Showing
- include/net/act_api.h 1 addition, 1 deletioninclude/net/act_api.h
- include/net/gen_stats.h 9 additions, 8 deletionsinclude/net/gen_stats.h
- include/net/netfilter/xt_rateest.h 7 additions, 3 deletionsinclude/net/netfilter/xt_rateest.h
- include/net/sch_generic.h 1 addition, 1 deletioninclude/net/sch_generic.h
- net/core/gen_estimator.c 107 additions, 192 deletionsnet/core/gen_estimator.c
- net/core/gen_stats.c 9 additions, 11 deletionsnet/core/gen_stats.c
- net/netfilter/xt_RATEEST.c 2 additions, 2 deletionsnet/netfilter/xt_RATEEST.c
- net/netfilter/xt_rateest.c 13 additions, 15 deletionsnet/netfilter/xt_rateest.c
- net/sched/act_api.c 3 additions, 6 deletionsnet/sched/act_api.c
- net/sched/act_police.c 12 additions, 9 deletionsnet/sched/act_police.c
- net/sched/sch_api.c 1 addition, 1 deletionnet/sched/sch_api.c
- net/sched/sch_cbq.c 3 additions, 3 deletionsnet/sched/sch_cbq.c
- net/sched/sch_drr.c 3 additions, 3 deletionsnet/sched/sch_drr.c
- net/sched/sch_generic.c 1 addition, 1 deletionnet/sched/sch_generic.c
- net/sched/sch_hfsc.c 3 additions, 3 deletionsnet/sched/sch_hfsc.c
- net/sched/sch_htb.c 3 additions, 3 deletionsnet/sched/sch_htb.c
- net/sched/sch_qfq.c 4 additions, 4 deletionsnet/sched/sch_qfq.c
Loading
Please register or sign in to comment