Re: [PATCH] NET : change layout of ehash table

2007-02-09 Thread Andi Kleen
On Friday 09 February 2007 10:43, David Miller wrote: > Current gcc does the right thing, even for weird sizes like 56 and 52 > which expands to many IALU operations. ... except if you use -Os, which at least on x86* is default and is what distros ship with. -Andi - To unsubscribe from this lis

Re: [PATCH] NET : change layout of ehash table

2007-02-09 Thread David Miller
From: Eric Dumazet <[EMAIL PROTECTED]> Date: Fri, 9 Feb 2007 10:36:58 +0100 > Thats strange, because pointer arithmetic is unsigned... > I dont know when gcc started to use reciprocal division, maybe your gcc was > very old ? Yep, it was only on older gcc's. And as the sparc gcc backend co-main

Re: [PATCH] NET : change layout of ehash table

2007-02-09 Thread Eric Dumazet
On Friday 09 February 2007 10:15, David Miller wrote: > From: Eric Dumazet <[EMAIL PROTECTED]> > Date: Fri, 9 Feb 2007 10:06:24 +0100 > > > Yes, but a decent C compiler for such targets should not use a > > multiply instruction to perform a (idx * 12) operation... :) > > Good point. > > Actually, I

Re: [PATCH] NET : change layout of ehash table

2007-02-09 Thread David Miller
From: Eric Dumazet <[EMAIL PROTECTED]> Date: Fri, 9 Feb 2007 10:06:24 +0100 > Yes, but a decent C compiler for such targets should not use a > multiply instruction to perform a (idx * 12) operation... :) Good point. Actually, I could never get GCC to avoid a divide on sparc64 for certain kinds o

Re: [PATCH] NET : change layout of ehash table

2007-02-09 Thread Eric Dumazet
On Friday 09 February 2007 09:40, David Miller wrote: > From: Andi Kleen <[EMAIL PROTECTED]> > Date: 09 Feb 2007 10:18:03 +0100 > > > David Miller <[EMAIL PROTECTED]> writes: > > > I've applied this, but I _REALLY_ don't like the new multiply > > > instructions that are used now in the hash indexin

Re: [PATCH] NET : change layout of ehash table

2007-02-09 Thread Andi Kleen
On Friday 09 February 2007 09:40, David Miller wrote: > From: Andi Kleen <[EMAIL PROTECTED]> > Date: 09 Feb 2007 10:18:03 +0100 > > > David Miller <[EMAIL PROTECTED]> writes: > > > > > > I've applied this, but I _REALLY_ don't like the new multiply > > > instructions that are used now in the hash

Re: [PATCH] NET : change layout of ehash table

2007-02-09 Thread David Miller
From: Andi Kleen <[EMAIL PROTECTED]> Date: 09 Feb 2007 10:18:03 +0100 > David Miller <[EMAIL PROTECTED]> writes: > > > > I've applied this, but I _REALLY_ don't like the new multiply > > instructions that are used now in the hash indexing paths when > > CONFIG_SMP is set. > > > > I think that's

Re: [PATCH] NET : change layout of ehash table

2007-02-09 Thread Andi Kleen
David Miller <[EMAIL PROTECTED]> writes: > > I've applied this, but I _REALLY_ don't like the new multiply > instructions that are used now in the hash indexing paths when > CONFIG_SMP is set. > > I think that's a higher cost than the memory waste. You're serious? multiply on a modern CPU is _mu

Re: [PATCH] NET : change layout of ehash table

2007-02-08 Thread David Miller
From: Eric Dumazet <[EMAIL PROTECTED]> Date: Wed, 7 Feb 2007 11:59:34 +0100 > ehash table layout is currently this one : > > First half of this table is used by sockets not in TIME_WAIT state > Second half of it is used by sockets in TIME_WAIT state. > > This is non optimal because of for a give

[PATCH] NET : change layout of ehash table

2007-02-07 Thread Eric Dumazet
ehash table layout is currently this one : First half of this table is used by sockets not in TIME_WAIT state Second half of it is used by sockets in TIME_WAIT state. This is non optimal because of for a given hash or socket, the two chain heads are located in separate cache lines. Moreover the