[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[altq 1434] Re: altq-3.1 on top of FreeBSD 4.5: HFSC bug/problem
Oleg Cherevko wrote:
> I've found a minor bug in the HFSC code that sometimes causes HFSC to
> behave rather unfair under link-sharing scheduler distributing all the
> excess bandwidth to a single class. This applies to FreeBSD 4.5 but may
> also apply to other *BSDs/versions.
> The problem function is init_v(). It uses function max() on 64-bit vt
> values, while in the <SYS-SRC-PATH>/sys/libkern.h max() is defined to
> operate on 32-bit u_int-s. Because of this the vt value is sometimes
> truncated to 32 bits, i.e. becomes significantly lower that those of
> competing sibling classes and the class in question receives unfair amount
> of link-sharing service.
> The below patch fixes the problem by simply avoiding the finction max().
> I hope this doesn't significantly influence the clarity of the code.
Thanks for finding this out. I'm curious how you found it.
(this was the most difficult logic for me to understand in the HFSC