Re: [patch 09/10] SLUB: Do our own locking via slab_lock and slab_unlock.

2007-10-30 Thread Nick Piggin
On Wednesday 31 October 2007 05:32, Christoph Lameter wrote: > On Tue, 30 Oct 2007, Nick Piggin wrote: > > Is this actually a speedup on any architecture to roll your own locking > > rather than using bit spinlock? > > It avoids one load from memory when allocating and the release is simply >

Re: [patch 09/10] SLUB: Do our own locking via slab_lock and slab_unlock.

2007-10-30 Thread Christoph Lameter
On Tue, 30 Oct 2007, Nick Piggin wrote: > Is this actually a speedup on any architecture to roll your own locking > rather than using bit spinlock? It avoids one load from memory when allocating and the release is simply writing the page->flags back. Less instructions. > I am not exactly

Re: [patch 09/10] SLUB: Do our own locking via slab_lock and slab_unlock.

2007-10-30 Thread Christoph Lameter
On Tue, 30 Oct 2007, Nick Piggin wrote: Is this actually a speedup on any architecture to roll your own locking rather than using bit spinlock? It avoids one load from memory when allocating and the release is simply writing the page-flags back. Less instructions. I am not exactly convinced

Re: [patch 09/10] SLUB: Do our own locking via slab_lock and slab_unlock.

2007-10-30 Thread Nick Piggin
On Wednesday 31 October 2007 05:32, Christoph Lameter wrote: On Tue, 30 Oct 2007, Nick Piggin wrote: Is this actually a speedup on any architecture to roll your own locking rather than using bit spinlock? It avoids one load from memory when allocating and the release is simply writing the

Re: [patch 09/10] SLUB: Do our own locking via slab_lock and slab_unlock.

2007-10-29 Thread Nick Piggin
On Sunday 28 October 2007 14:32, Christoph Lameter wrote: > Too many troubles with the bitlocks and we really do not need > to do any bitops. Bitops do not effectively retrieve the old > value which we want. So use a cmpxchg instead on the arches > that allow it. > > Instead of modifying the

Re: [patch 09/10] SLUB: Do our own locking via slab_lock and slab_unlock.

2007-10-29 Thread Nick Piggin
On Sunday 28 October 2007 14:32, Christoph Lameter wrote: Too many troubles with the bitlocks and we really do not need to do any bitops. Bitops do not effectively retrieve the old value which we want. So use a cmpxchg instead on the arches that allow it. Instead of modifying the page-flags

Re: [patch 09/10] SLUB: Do our own locking via slab_lock and slab_unlock.

2007-10-28 Thread Pekka Enberg
Hi, On 10/29/07, Christoph Lameter <[EMAIL PROTECTED]> wrote: > > We don't need preempt_enable for CONFIG_SMP, right? > > preempt_enable is needed if preemption is enabled. Disabled? But yeah, I see that slab_trylock() can leave preemption disabled if cmpxchg fails. Was confused by the

Re: [patch 09/10] SLUB: Do our own locking via slab_lock and slab_unlock.

2007-10-28 Thread Christoph Lameter
On Sun, 28 Oct 2007, Pekka J Enberg wrote: > It would be easier to review the actual locking changes if you did the > SlabXXX removal in a separate patch. There are no locking changes. > > -static __always_inline void slab_lock(struct page *page) > > +static __always_inline void

Re: [patch 09/10] SLUB: Do our own locking via slab_lock and slab_unlock.

2007-10-28 Thread Pekka J Enberg
On Sun, 28 Oct 2007, Pekka J Enberg wrote: > > +__release(bitlock); > > This needs a less generic name and maybe a comment explaining that it's > not annotating a proper lock? Or maybe we can drop it completely? Ah, I see that does the same thing, so strike that. - To unsubscribe from this

Re: [patch 09/10] SLUB: Do our own locking via slab_lock and slab_unlock.

2007-10-28 Thread Pekka J Enberg
Hi Christoph, On Sat, 27 Oct 2007, Christoph Lameter wrote: > Too many troubles with the bitlocks and we really do not need > to do any bitops. Bitops do not effectively retrieve the old > value which we want. So use a cmpxchg instead on the arches > that allow it. > -static inline int

Re: [patch 09/10] SLUB: Do our own locking via slab_lock and slab_unlock.

2007-10-28 Thread Pekka J Enberg
Hi Christoph, On Sat, 27 Oct 2007, Christoph Lameter wrote: Too many troubles with the bitlocks and we really do not need to do any bitops. Bitops do not effectively retrieve the old value which we want. So use a cmpxchg instead on the arches that allow it. -static inline int

Re: [patch 09/10] SLUB: Do our own locking via slab_lock and slab_unlock.

2007-10-28 Thread Pekka J Enberg
On Sun, 28 Oct 2007, Pekka J Enberg wrote: +__release(bitlock); This needs a less generic name and maybe a comment explaining that it's not annotating a proper lock? Or maybe we can drop it completely? Ah, I see that linux/bit_spinlock.h does the same thing, so strike that. - To

Re: [patch 09/10] SLUB: Do our own locking via slab_lock and slab_unlock.

2007-10-28 Thread Christoph Lameter
On Sun, 28 Oct 2007, Pekka J Enberg wrote: It would be easier to review the actual locking changes if you did the SlabXXX removal in a separate patch. There are no locking changes. -static __always_inline void slab_lock(struct page *page) +static __always_inline void slab_unlock(struct

Re: [patch 09/10] SLUB: Do our own locking via slab_lock and slab_unlock.

2007-10-28 Thread Pekka Enberg
Hi, On 10/29/07, Christoph Lameter [EMAIL PROTECTED] wrote: We don't need preempt_enable for CONFIG_SMP, right? preempt_enable is needed if preemption is enabled. Disabled? But yeah, I see that slab_trylock() can leave preemption disabled if cmpxchg fails. Was confused by the #ifdefs... :-)

[patch 09/10] SLUB: Do our own locking via slab_lock and slab_unlock.

2007-10-27 Thread Christoph Lameter
Too many troubles with the bitlocks and we really do not need to do any bitops. Bitops do not effectively retrieve the old value which we want. So use a cmpxchg instead on the arches that allow it. Instead of modifying the page->flags with fake atomic operations we pass the page state as a

[patch 09/10] SLUB: Do our own locking via slab_lock and slab_unlock.

2007-10-27 Thread Christoph Lameter
Too many troubles with the bitlocks and we really do not need to do any bitops. Bitops do not effectively retrieve the old value which we want. So use a cmpxchg instead on the arches that allow it. Instead of modifying the page-flags with fake atomic operations we pass the page state as a