[Codel] fp sqrt vis int sqrt?

Eric Dumazet eric.dumazet at gmail.com
Fri May 4 13:47:32 EDT 2012


On Fri, 2012-05-04 at 10:23 -0700, Dave Taht wrote:

> In looking over the (lack of) compiler support for fp in the kernel,
> it seems simplest to load up a table from userspace for the
> interval/sqrt(count) calculation.

Well, you could have a small table (not from userspace, thats really not
needed at all) for the 16 first sqrt values.

More over, for the first sqrt values you can use reciprocal divide so
that we dont have a divide anymore (see include/linux/reciprocal_div.h),
and you can have a very precise sqrt this way, not an integral one.

With count >= 16, the error you mention becomes small.






More information about the Codel mailing list