回复: pow function in kernel space

Mateusz Guzik mjguzik at gmail.com
Fri Jun 20 01:29:00 UTC 2014


On Fri, Jun 20, 2014 at 08:59:49AM +0800, 张晗 wrote:
> Hi:
>   
>  I am doing a research on D2TCP(http://dl.acm.org/citation.cfm?id=2342388), I just want to implement it into the linux kernel. When calculating the penalty function, it is p = a^d, where 0< a < 1 and  0< d < 1. Since the kernel only offers integer,   so in my code, so I let a multiply 2^10. But I have no idea of calculating a^d when 0< d < 1. May be I want a  approximate algorithm or other methods. Can you help me ?
>  thanks~
>   

First of all this is a FreeBSD list and FreeBSD is not Linux.

It is possible to use FPU in kernel mode, but it requires some
additional work.

Both FreeBSD and Linux kernels provide functions for this purpose, see
kernel_fpu_begin and kernel_fpu_end on Linux.

I suggest you send further questions to some Linux-related resource,
although I can't recommend any in particular.

-- 
Mateusz Guzik <mjguzik gmail.com>


More information about the freebsd-net mailing list