[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[altq 468] Re: **HEADS UP** altq change 1st round
Cheng Hong wrote:
> > 2.5 tokenbucket regulator
> > The purpose of the token bucket regulator is to limit the amount of
> > packets that a driver can dequeue.
> > A token bucket has "rate" and "size". Tokens accumulate in a bucket
> > at the average "rate", up to the bucket "size".
> > A driver can dequeue a packet as long as there are positive tokens,
> > and after a packet is dequeued, the size of the packet is subtracted
> > from the tokens.
> I feel this should be part of the queuing discipline's work. It should be up
> to the specific queue discipline to implement. If you add this to the
> framework, which would apply to all discipliens, it might undermine the
> performance of certain disciplines.
I believe that all disciplines need it. If the underlying driver
dequeues excessive packets at a time, every discipline I know of loses
control. Of course, a discipline can disable the token bucket
regulator if it wants to.
The performance impact is negligible. The tokenbucket regulator
uses the CPU cycle counter on i386 and alpha as it is much cheaper
than microtime() on these platforms.