From: Andi Kleen <[EMAIL PROTECTED]>
Date: Tue, 7 Mar 2006 19:50:52 +0100

> On Wednesday 08 March 2006 02:29, Benjamin LaHaise wrote:
> > On Tue, Mar 07, 2006 at 05:27:37PM +0100, Andi Kleen wrote:
> > > On Wednesday 08 March 2006 00:26, Benjamin LaHaise wrote:
> > > > Hi Andi,
> > > > 
> > > > On x86-64 one inefficiency that shows up on profiles is the handling of 
> > > > struct page conversion to/from idx and addresses.  This is mostly due 
> > > > to 
> > > > the fact that struct page is currently 56 bytes on x86-64, so gcc has 
> > > > to 
> > > > emit a slow division or multiplication to convert. 
> > > 
> > > Huh? 
> > 
> > You used an unsigned long, but ptrdiff_t is signed.  gcc cannot use any 
> > shifting tricks because they round incorrectly in the signed case.
> 
> 
> My vmlinux has

Right, it uses the imul because gcc has determined that the shift/add
tricks expand to more cycles than the multiply by reciprocol would
take.

It's very cpu and gcc dependant what code sequence you get here.

I still think using a power-of-2 for the page struct is still
probably a good thing to do, however.  I've always been tempted
to do this on sparc64.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to