lkml.org 
[lkml]   [2000]   [Dec]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: test13-pre5
On Thu, Dec 28, 2000 at 02:54:52PM -0800, David S. Miller wrote:
> Date: Thu, 28 Dec 2000 23:58:36 +0100
> From: Andi Kleen <ak@suse.de>
>
> Why exactly a power of two ? To get rid of ->index ?
>
> To make things like "page - mem_map" et al. use shifts instead of
> expensive multiplies...

I thought that is what ->index is for ?

Also gcc seems to be already quite clever at dividing through small
integers, e.g. using mul and shift and sub, so it may not be even worth to reach
for a real power-of-two.

I suspect doing the arithmetics is at least faster than eating the
cache misses because of ->index.

-Andikkk


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:52    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site