Re: [PATCH] SLAB : use a multiply instead of a divide in obj_to_index()

Christoph Lameter
2006-12-04T16:56:00Z

On Mon, 4 Dec 2006, Eric Dumazet wrote:

> Doing some math, we can use a reciprocal multiplication instead of a divide.

Could you generalize the reciprocal thingy so that the division
can be used from other parts of the kernel as well? It would be useful to
separately get some cycle counts on a regular division compared with your
division. If that shows benefit then we may think about using it in the
kernel. I am a bit surprised that this is still an issue on modern cpus.