Re: [patch] generic rwsems

2007-04-13 Thread David Howells
Eric Dumazet <[EMAIL PROTECTED]> wrote: > If space considerations are that important, we could then reserve one bit > for the 'wait_lock spinlock' That makes life quite a bit more tricky, though it does have the advantage that it closes the reader-jumping-writer window I mentioned. > Another

Re: [patch] generic rwsems

2007-04-13 Thread Eric Dumazet
On Fri, 13 Apr 2007 14:31:52 +0100 David Howells <[EMAIL PROTECTED]> wrote: > Break the counter down like this: > > 0x - not locked; queue empty > 0x4000 - locked by writer; queue empty > 0xc000 - locket by writer; queue occupied >

Re: [patch] generic rwsems

2007-04-13 Thread Nick Piggin
On Fri, Apr 13, 2007 at 02:31:52PM +0100, David Howells wrote: > Nick Piggin <[EMAIL PROTECTED]> wrote: > > > The other way happens to be better for everyone else, which is why I > > think your suggestion to instead move everyone to the spinlock version > > was weird. > > No, you misunderstand

Re: [patch] generic rwsems

2007-04-13 Thread David Howells
Nick Piggin <[EMAIL PROTECTED]> wrote: > The other way happens to be better for everyone else, which is why I > think your suggestion to instead move everyone to the spinlock version > was weird. No, you misunderstand me. My preferred solution is to leave it up to the arch and not to make it

Re: [patch] generic rwsems

2007-04-13 Thread William Lee Irwin III
On Fri, Apr 13, 2007 at 02:43:03PM +0200, Nick Piggin wrote: > Yes, this is the case on our 2 premiere SMP powerhouse architectures, > sparc32 and parsic. sparc32 is ultra-legacy and I have a tremendous amount of work to do on SMP there. I don't feel that efficiency of locking primitives is a

Re: [patch] generic rwsems

2007-04-13 Thread Nick Piggin
David, you keep saying the same things and don't listen to me. On Fri, Apr 13, 2007 at 01:09:42PM +0100, David Howells wrote: > Nick Piggin <[EMAIL PROTECTED]> wrote: > > > This patch converts all architectures to a generic rwsem implementation, > > which will compile down to the same code for

Re: [patch] generic rwsems

2007-04-13 Thread Christoph Hellwig
On Fri, Apr 13, 2007 at 12:44:50PM +0100, David Howells wrote: > Nick Piggin <[EMAIL PROTECTED]> wrote: > > > I think I should put wait_lock after wait_list, so as to get a better > > packing on most 64-bit architectures. > > It makes no difference. struct lockdep_map contains at least one

Re: [patch] generic rwsems

2007-04-13 Thread David Howells
Nick Piggin <[EMAIL PROTECTED]> wrote: > This patch converts all architectures to a generic rwsem implementation, > which will compile down to the same code for i386, or powerpc, for > example, > and will allow some (eg. x86-64) to move away from spinlock based rwsems. Which are better on UP

Re: [patch] generic rwsems

2007-04-13 Thread David Howells
Nick Piggin <[EMAIL PROTECTED]> wrote: > I think I should put wait_lock after wait_list, so as to get a better > packing on most 64-bit architectures. It makes no difference. struct lockdep_map contains at least one pointer and so is going to be 8-byte aligned (assuming it's there at all).

Re: [patch] generic rwsems

2007-04-13 Thread Nick Piggin
On Fri, Apr 13, 2007 at 12:53:49PM +0200, Andi Kleen wrote: > On Friday 13 April 2007 12:04:16 Nick Piggin wrote: > > OK, this patch is against 2.6.21-rc6 + Mathieu's atomic_long patches. > > > > Last time this came up I was asked to get some numbers, so here are > > some in the changelog,

Re: fastcalls, was Re: [patch] generic rwsems

2007-04-13 Thread Nick Piggin
On Fri, Apr 13, 2007 at 11:19:30AM +0100, Christoph Hellwig wrote: > On Fri, Apr 13, 2007 at 12:04:16PM +0200, Nick Piggin wrote: > > Remove one level of indirection (kernel/rwsem.c -> lib/rwsem.c), and > > give a bit of a cleanup (eg remove the fastcall junk) to make the > > code a bit easier to

Re: [patch] generic rwsems

2007-04-13 Thread Andi Kleen
On Friday 13 April 2007 12:04:16 Nick Piggin wrote: > OK, this patch is against 2.6.21-rc6 + Mathieu's atomic_long patches. > > Last time this came up I was asked to get some numbers, so here are > some in the changelog, captured with a simple kernel module tester. > I got motivated again because

Re: [patch] generic rwsems

2007-04-13 Thread Nick Piggin
On Fri, Apr 13, 2007 at 12:04:16PM +0200, Nick Piggin wrote: > OK, this patch is against 2.6.21-rc6 + Mathieu's atomic_long patches. > > Last time this came up I was asked to get some numbers, so here are > some in the changelog, captured with a simple kernel module tester. > I got motivated

fastcalls, was Re: [patch] generic rwsems

2007-04-13 Thread Christoph Hellwig
On Fri, Apr 13, 2007 at 12:04:16PM +0200, Nick Piggin wrote: > Remove one level of indirection (kernel/rwsem.c -> lib/rwsem.c), and > give a bit of a cleanup (eg remove the fastcall junk) to make the > code a bit easier to read. Arpopos fastcalls, now that -mregparam=3 is the defaul on i386 and

fastcalls, was Re: [patch] generic rwsems

2007-04-13 Thread Christoph Hellwig
On Fri, Apr 13, 2007 at 12:04:16PM +0200, Nick Piggin wrote: Remove one level of indirection (kernel/rwsem.c - lib/rwsem.c), and give a bit of a cleanup (eg remove the fastcall junk) to make the code a bit easier to read. Arpopos fastcalls, now that -mregparam=3 is the defaul on i386 and

Re: [patch] generic rwsems

2007-04-13 Thread Nick Piggin
On Fri, Apr 13, 2007 at 12:04:16PM +0200, Nick Piggin wrote: OK, this patch is against 2.6.21-rc6 + Mathieu's atomic_long patches. Last time this came up I was asked to get some numbers, so here are some in the changelog, captured with a simple kernel module tester. I got motivated again

Re: [patch] generic rwsems

2007-04-13 Thread Andi Kleen
On Friday 13 April 2007 12:04:16 Nick Piggin wrote: OK, this patch is against 2.6.21-rc6 + Mathieu's atomic_long patches. Last time this came up I was asked to get some numbers, so here are some in the changelog, captured with a simple kernel module tester. I got motivated again because of

Re: fastcalls, was Re: [patch] generic rwsems

2007-04-13 Thread Nick Piggin
On Fri, Apr 13, 2007 at 11:19:30AM +0100, Christoph Hellwig wrote: On Fri, Apr 13, 2007 at 12:04:16PM +0200, Nick Piggin wrote: Remove one level of indirection (kernel/rwsem.c - lib/rwsem.c), and give a bit of a cleanup (eg remove the fastcall junk) to make the code a bit easier to read.

Re: [patch] generic rwsems

2007-04-13 Thread Nick Piggin
On Fri, Apr 13, 2007 at 12:53:49PM +0200, Andi Kleen wrote: On Friday 13 April 2007 12:04:16 Nick Piggin wrote: OK, this patch is against 2.6.21-rc6 + Mathieu's atomic_long patches. Last time this came up I was asked to get some numbers, so here are some in the changelog, captured with a

Re: [patch] generic rwsems

2007-04-13 Thread David Howells
Nick Piggin [EMAIL PROTECTED] wrote: I think I should put wait_lock after wait_list, so as to get a better packing on most 64-bit architectures. It makes no difference. struct lockdep_map contains at least one pointer and so is going to be 8-byte aligned (assuming it's there at all). struct

Re: [patch] generic rwsems

2007-04-13 Thread David Howells
Nick Piggin [EMAIL PROTECTED] wrote: This patch converts all architectures to a generic rwsem implementation, which will compile down to the same code for i386, or powerpc, for example, and will allow some (eg. x86-64) to move away from spinlock based rwsems. Which are better on UP kernels

Re: [patch] generic rwsems

2007-04-13 Thread Christoph Hellwig
On Fri, Apr 13, 2007 at 12:44:50PM +0100, David Howells wrote: Nick Piggin [EMAIL PROTECTED] wrote: I think I should put wait_lock after wait_list, so as to get a better packing on most 64-bit architectures. It makes no difference. struct lockdep_map contains at least one pointer and

Re: [patch] generic rwsems

2007-04-13 Thread Nick Piggin
David, you keep saying the same things and don't listen to me. On Fri, Apr 13, 2007 at 01:09:42PM +0100, David Howells wrote: Nick Piggin [EMAIL PROTECTED] wrote: This patch converts all architectures to a generic rwsem implementation, which will compile down to the same code for i386, or

Re: [patch] generic rwsems

2007-04-13 Thread William Lee Irwin III
On Fri, Apr 13, 2007 at 02:43:03PM +0200, Nick Piggin wrote: Yes, this is the case on our 2 premiere SMP powerhouse architectures, sparc32 and parsic. sparc32 is ultra-legacy and I have a tremendous amount of work to do on SMP there. I don't feel that efficiency of locking primitives is a

Re: [patch] generic rwsems

2007-04-13 Thread David Howells
Nick Piggin [EMAIL PROTECTED] wrote: The other way happens to be better for everyone else, which is why I think your suggestion to instead move everyone to the spinlock version was weird. No, you misunderstand me. My preferred solution is to leave it up to the arch and not to make it

Re: [patch] generic rwsems

2007-04-13 Thread Nick Piggin
On Fri, Apr 13, 2007 at 02:31:52PM +0100, David Howells wrote: Nick Piggin [EMAIL PROTECTED] wrote: The other way happens to be better for everyone else, which is why I think your suggestion to instead move everyone to the spinlock version was weird. No, you misunderstand me. My

Re: [patch] generic rwsems

2007-04-13 Thread Eric Dumazet
On Fri, 13 Apr 2007 14:31:52 +0100 David Howells [EMAIL PROTECTED] wrote: Break the counter down like this: 0x - not locked; queue empty 0x4000 - locked by writer; queue empty 0xc000 - locket by writer; queue occupied 0x0nnn

Re: [patch] generic rwsems

2007-04-13 Thread David Howells
Eric Dumazet [EMAIL PROTECTED] wrote: If space considerations are that important, we could then reserve one bit for the 'wait_lock spinlock' That makes life quite a bit more tricky, though it does have the advantage that it closes the reader-jumping-writer window I mentioned. Another