Subject: Re: [PATCH] sch_htb.c consume the classes's tokens bellow the HTB_CAN_SEND level

From: Martin Devera <[email-masked]>
Date: Wed, 04 Nov 2009 13:15:34 +0100

Changli Gao wrote:
> On Wed, Nov 4, 2009 at 7:58 PM, Martin Devera <[email-masked]> wrote:
>> Ahh I'm starting to understand. You are concerned mainly with
>>
>> cl->tokens += diff;     /* we moved t_c; update tokens */
>>
>> am I right ?
>>
> 
> If we don't need to charge the tokens, updating it is necessary. I am
> arguing the tokens isn't updated with the ctokens when the
> corresponding class is in HTB_MAY_BORROW mode.
> 

Ok, then the reason is in "logic". When you have parent P and children
A,B each with half of rate and only A is sending, than we want A to use
its own rate and also B's rate. B's rate is available as excess in P.
Here I see correct to charge part to A and part to P, while you want
to charge one P and twice A. Only mbuffer will limit the duplicity.
And it is not good idea because tokens can go very negative and then 
ittroduce A's stall for some time.
I see no principial benefit...