Re: [patch 1/4] spinlock: lockbreak cleanup

2007-11-01 Thread Nick Piggin
On Thu, Nov 01, 2007 at 04:46:36PM +0100, Ingo Molnar wrote: > > * Lee Schermerhorn <[EMAIL PROTECTED]> wrote: > > > > I guess it was done to make the "template" hacks eaiser. I don't > > > really find that in good taste, especially for important core > > > infrastructure. Anyway. > > > >

Re: [patch 1/4] spinlock: lockbreak cleanup

2007-11-01 Thread Ingo Molnar
* Lee Schermerhorn <[EMAIL PROTECTED]> wrote: > > I guess it was done to make the "template" hacks eaiser. I don't > > really find that in good taste, especially for important core > > infrastructure. Anyway. > > Actually, what I had/have is a cond_resched_rwlock() that I needed to > convert

Re: [patch 1/4] spinlock: lockbreak cleanup

2007-11-01 Thread Lee Schermerhorn
On Thu, 2007-11-01 at 15:29 +0100, Nick Piggin wrote: > On Thu, Nov 01, 2007 at 03:06:05PM +0100, Peter Zijlstra wrote: > > On Thu, 2007-11-01 at 15:02 +0100, Nick Piggin wrote: > > > > > Rename need_lockbreak to spin_needbreak, make it use spin_is_contended to > > > decouple it from the spinlock

Re: [patch 1/4] spinlock: lockbreak cleanup

2007-11-01 Thread Nick Piggin
On Thu, Nov 01, 2007 at 03:06:05PM +0100, Peter Zijlstra wrote: > On Thu, 2007-11-01 at 15:02 +0100, Nick Piggin wrote: > > > Rename need_lockbreak to spin_needbreak, make it use spin_is_contended to > > decouple it from the spinlock implementation, and make it typesafe (rwlocks > > do not have

Re: [patch 1/4] spinlock: lockbreak cleanup

2007-11-01 Thread Peter Zijlstra
On Thu, 2007-11-01 at 15:02 +0100, Nick Piggin wrote: > Rename need_lockbreak to spin_needbreak, make it use spin_is_contended to > decouple it from the spinlock implementation, and make it typesafe (rwlocks > do not have any need_lockbreak sites -- why do they even get bloated up > with that

[patch 1/4] spinlock: lockbreak cleanup

2007-11-01 Thread Nick Piggin
The break_lock data structure and code for spinlocks is quite nasty. Not only does it double the size of a spinlock but it changes locking to a potentially less optimal trylock. Put all of that under CONFIG_GENERIC_LOCKBREAK, and introduce a __raw_spin_is_contended that uses the lock data itself

[patch 1/4] spinlock: lockbreak cleanup

2007-11-01 Thread Nick Piggin
The break_lock data structure and code for spinlocks is quite nasty. Not only does it double the size of a spinlock but it changes locking to a potentially less optimal trylock. Put all of that under CONFIG_GENERIC_LOCKBREAK, and introduce a __raw_spin_is_contended that uses the lock data itself

Re: [patch 1/4] spinlock: lockbreak cleanup

2007-11-01 Thread Peter Zijlstra
On Thu, 2007-11-01 at 15:02 +0100, Nick Piggin wrote: Rename need_lockbreak to spin_needbreak, make it use spin_is_contended to decouple it from the spinlock implementation, and make it typesafe (rwlocks do not have any need_lockbreak sites -- why do they even get bloated up with that

Re: [patch 1/4] spinlock: lockbreak cleanup

2007-11-01 Thread Nick Piggin
On Thu, Nov 01, 2007 at 03:06:05PM +0100, Peter Zijlstra wrote: On Thu, 2007-11-01 at 15:02 +0100, Nick Piggin wrote: Rename need_lockbreak to spin_needbreak, make it use spin_is_contended to decouple it from the spinlock implementation, and make it typesafe (rwlocks do not have any

Re: [patch 1/4] spinlock: lockbreak cleanup

2007-11-01 Thread Lee Schermerhorn
On Thu, 2007-11-01 at 15:29 +0100, Nick Piggin wrote: On Thu, Nov 01, 2007 at 03:06:05PM +0100, Peter Zijlstra wrote: On Thu, 2007-11-01 at 15:02 +0100, Nick Piggin wrote: Rename need_lockbreak to spin_needbreak, make it use spin_is_contended to decouple it from the spinlock

Re: [patch 1/4] spinlock: lockbreak cleanup

2007-11-01 Thread Ingo Molnar
* Lee Schermerhorn [EMAIL PROTECTED] wrote: I guess it was done to make the template hacks eaiser. I don't really find that in good taste, especially for important core infrastructure. Anyway. Actually, what I had/have is a cond_resched_rwlock() that I needed to convert the

Re: [patch 1/4] spinlock: lockbreak cleanup

2007-11-01 Thread Nick Piggin
On Thu, Nov 01, 2007 at 04:46:36PM +0100, Ingo Molnar wrote: * Lee Schermerhorn [EMAIL PROTECTED] wrote: I guess it was done to make the template hacks eaiser. I don't really find that in good taste, especially for important core infrastructure. Anyway. Actually, what I