On Sat, May 4, 2019 at 8:41 AM Eric Dumazet <eric.duma...@gmail.com> wrote: > > > > On 5/2/19 2:06 PM, Cong Wang wrote: > > In commit 3c75f6ee139d ("net_sched: sch_htb: add per class overlimits > > counter") > > we added an overlimits counter for each HTB class which could > > properly reflect how many times we use up all the bandwidth > > on each class. However, the overlimits counter in HTB qdisc > > does not, it is way bigger than the sum of each HTB class. > > In fact, this qdisc overlimits counter increases when we have > > no skb to dequeue, which happens more often than we run out of > > bandwidth. > > > > It makes more sense to make this qdisc overlimits counter just > > be a sum of each HTB class, in case people still get confused. > > > > I have verified this patch with one single HTB class, where HTB > > qdisc counters now always match HTB class counters as expected. > > > > Cc: Eric Dumazet <eduma...@google.com> > > Signed-off-by: Cong Wang <xiyou.wangc...@gmail.com> > > --- > > net/sched/sch_htb.c | 7 +++++-- > > 1 file changed, 5 insertions(+), 2 deletions(-) > > > > diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c > > index d27d9bc9d010..cece0d455985 100644 > > --- a/net/sched/sch_htb.c > > +++ b/net/sched/sch_htb.c > > @@ -177,6 +177,7 @@ struct htb_sched { > > int row_mask[TC_HTB_MAXDEPTH]; > > > > struct htb_level hlevel[TC_HTB_MAXDEPTH]; > > + u32 overlimits; > > }; > > > Hi Cong, your patch makes sense, but I am not sure about the location of this > field, > as this might need another cache line miss. > > Maybe instead reduce 'long direct_pkts;' to 'u32 direct_pkts;' > since we only export > direct_pkts as 32bit quantity in the struct tc_htb_glob. > > Then move the 'u32 overlimits;' right after direct_pkts to fill the new hole.
Sure, v2 is coming. :) Thanks for catching it.