Re: Horrible regression with -CURRENT from "Don't busy-lock-loop in preemptable spinlocks" patch

2005-01-19 Thread Grant Grundler
On Thu, Jan 20, 2005 at 08:43:30AM +1100, Paul Mackerras wrote: > I suggest read_poll(), write_poll(), spin_poll(),... Erm...those names sound way too much like existing interfaces. Perhaps check_read_lock()/check_write_lock() ? If they don't get used too much, the longer name should be ok.

Re: Horrible regression with -CURRENT from "Don't busy-lock-loop in preemptable spinlocks" patch

2005-01-19 Thread Paul Mackerras
Ingo Molnar writes: > * Peter Chubb <[EMAIL PROTECTED]> wrote: > > > >> Here's a patch that adds the missing read_is_locked() and > > >> write_is_locked() macros for IA64. When combined with Ingo's > > >> patch, I can boot an SMP kernel with CONFIG_PREEMPT on. > > >> > > >> However, I feel

Re: Horrible regression with -CURRENT from "Don't busy-lock-loop in preemptable spinlocks" patch

2005-01-19 Thread Ingo Molnar
* Peter Chubb <[EMAIL PROTECTED]> wrote: > >> Here's a patch that adds the missing read_is_locked() and > >> write_is_locked() macros for IA64. When combined with Ingo's > >> patch, I can boot an SMP kernel with CONFIG_PREEMPT on. > >> > >> However, I feel these macros are misnamed:

Re: Horrible regression with -CURRENT from "Don't busy-lock-loop in preemptable spinlocks" patch

2005-01-19 Thread Peter Chubb
> "Ingo" == Ingo Molnar <[EMAIL PROTECTED]> writes: Ingo> * Peter Chubb <[EMAIL PROTECTED]> wrote: >> Here's a patch that adds the missing read_is_locked() and >> write_is_locked() macros for IA64. When combined with Ingo's >> patch, I can boot an SMP kernel with CONFIG_PREEMPT on. >> >>

Re: Horrible regression with -CURRENT from "Don't busy-lock-loop in preemptable spinlocks" patch

2005-01-19 Thread Ingo Molnar
* Peter Chubb <[EMAIL PROTECTED]> wrote: > Here's a patch that adds the missing read_is_locked() and > write_is_locked() macros for IA64. When combined with Ingo's patch, I > can boot an SMP kernel with CONFIG_PREEMPT on. > > However, I feel these macros are misnamed: read_is_locked() returns

Re: Horrible regression with -CURRENT from Don't busy-lock-loop in preemptable spinlocks patch

2005-01-19 Thread Ingo Molnar
* Peter Chubb [EMAIL PROTECTED] wrote: Here's a patch that adds the missing read_is_locked() and write_is_locked() macros for IA64. When combined with Ingo's patch, I can boot an SMP kernel with CONFIG_PREEMPT on. However, I feel these macros are misnamed: read_is_locked() returns true

Re: Horrible regression with -CURRENT from Don't busy-lock-loop in preemptable spinlocks patch

2005-01-19 Thread Peter Chubb
Ingo == Ingo Molnar [EMAIL PROTECTED] writes: Ingo * Peter Chubb [EMAIL PROTECTED] wrote: Here's a patch that adds the missing read_is_locked() and write_is_locked() macros for IA64. When combined with Ingo's patch, I can boot an SMP kernel with CONFIG_PREEMPT on. However, I feel these

Re: Horrible regression with -CURRENT from Don't busy-lock-loop in preemptable spinlocks patch

2005-01-19 Thread Ingo Molnar
* Peter Chubb [EMAIL PROTECTED] wrote: Here's a patch that adds the missing read_is_locked() and write_is_locked() macros for IA64. When combined with Ingo's patch, I can boot an SMP kernel with CONFIG_PREEMPT on. However, I feel these macros are misnamed: read_is_locked() returns

Re: Horrible regression with -CURRENT from Don't busy-lock-loop in preemptable spinlocks patch

2005-01-19 Thread Paul Mackerras
Ingo Molnar writes: * Peter Chubb [EMAIL PROTECTED] wrote: Here's a patch that adds the missing read_is_locked() and write_is_locked() macros for IA64. When combined with Ingo's patch, I can boot an SMP kernel with CONFIG_PREEMPT on. However, I feel these macros are misnamed:

Re: Horrible regression with -CURRENT from Don't busy-lock-loop in preemptable spinlocks patch

2005-01-19 Thread Grant Grundler
On Thu, Jan 20, 2005 at 08:43:30AM +1100, Paul Mackerras wrote: I suggest read_poll(), write_poll(), spin_poll(),... Erm...those names sound way too much like existing interfaces. Perhaps check_read_lock()/check_write_lock() ? If they don't get used too much, the longer name should be ok.

Re: Horrible regression with -CURRENT from "Don't busy-lock-loop in preemptable spinlocks" patch

2005-01-18 Thread Peter Chubb
Here's a patch that adds the missing read_is_locked() and write_is_locked() macros for IA64. When combined with Ingo's patch, I can boot an SMP kernel with CONFIG_PREEMPT on. However, I feel these macros are misnamed: read_is_locked() returns true if the lock is held for writing;

Re: Horrible regression with -CURRENT from Don't busy-lock-loop in preemptable spinlocks patch

2005-01-18 Thread Peter Chubb
Here's a patch that adds the missing read_is_locked() and write_is_locked() macros for IA64. When combined with Ingo's patch, I can boot an SMP kernel with CONFIG_PREEMPT on. However, I feel these macros are misnamed: read_is_locked() returns true if the lock is held for writing;

Re: Horrible regression with -CURRENT from "Don't busy-lock-loop in preemptable spinlocks" patch

2005-01-17 Thread Chris Wedgwood
On Tue, Jan 18, 2005 at 03:28:58PM +1100, Darren Williams wrote: > On top of Ingo's patch I attempt a solution that failed: > +#define read_is_locked(x)(*(volatile int *) (x) > 0) > +#define write_is_locked(x) (*(volatile int *) (x) < 0) how about something like: #define

Re: Horrible regression with -CURRENT from "Don't busy-lock-loop in preemptable spinlocks" patch

2005-01-17 Thread Darren Williams
On Tue, 18 Jan 2005, Darren Williams wrote: > Hi Ingo > > On Mon, 17 Jan 2005, Ingo Molnar wrote: > > > > > * Andrew Morton <[EMAIL PROTECTED]> wrote: > > > > > > +BUILD_LOCK_OPS(spin, spinlock_t, spin_is_locked); > > > > +BUILD_LOCK_OPS(read, rwlock_t, rwlock_is_locked); > > > >

Re: Horrible regression with -CURRENT from "Don't busy-lock-loop in preemptable spinlocks" patch

2005-01-17 Thread Darren Williams
Hi Ingo On Mon, 17 Jan 2005, Ingo Molnar wrote: > > * Andrew Morton <[EMAIL PROTECTED]> wrote: > > > > +BUILD_LOCK_OPS(spin, spinlock_t, spin_is_locked); > > > +BUILD_LOCK_OPS(read, rwlock_t, rwlock_is_locked); > > > +BUILD_LOCK_OPS(write, rwlock_t, spin_is_locked); > > > > If you replace the

Re: Horrible regression with -CURRENT from "Don't busy-lock-loop in preemptable spinlocks" patch

2005-01-17 Thread Ingo Molnar
* Andrew Morton <[EMAIL PROTECTED]> wrote: > > +BUILD_LOCK_OPS(spin, spinlock_t, spin_is_locked); > > +BUILD_LOCK_OPS(read, rwlock_t, rwlock_is_locked); > > +BUILD_LOCK_OPS(write, rwlock_t, spin_is_locked); > > If you replace the last line with > > BUILD_LOCK_OPS(write, rwlock_t,

Re: Horrible regression with -CURRENT from "Don't busy-lock-loop in preemptable spinlocks" patch

2005-01-17 Thread Chris Wedgwood
On Mon, Jan 17, 2005 at 06:50:57PM +1100, Paul Mackerras wrote: > AFAICS on i386 the lock word, although it goes to 0 when write-locked, > can then go negative temporarily when another cpu tries to get a read > or write lock. So I think this should be > > ((signed int)(x)->lock <= 0) I think

Re: Horrible regression with -CURRENT from Don't busy-lock-loop in preemptable spinlocks patch

2005-01-17 Thread Chris Wedgwood
On Mon, Jan 17, 2005 at 06:50:57PM +1100, Paul Mackerras wrote: AFAICS on i386 the lock word, although it goes to 0 when write-locked, can then go negative temporarily when another cpu tries to get a read or write lock. So I think this should be ((signed int)(x)-lock = 0) I think you're

Re: Horrible regression with -CURRENT from Don't busy-lock-loop in preemptable spinlocks patch

2005-01-17 Thread Ingo Molnar
* Andrew Morton [EMAIL PROTECTED] wrote: +BUILD_LOCK_OPS(spin, spinlock_t, spin_is_locked); +BUILD_LOCK_OPS(read, rwlock_t, rwlock_is_locked); +BUILD_LOCK_OPS(write, rwlock_t, spin_is_locked); If you replace the last line with BUILD_LOCK_OPS(write, rwlock_t, rwlock_is_locked);

Re: Horrible regression with -CURRENT from Don't busy-lock-loop in preemptable spinlocks patch

2005-01-17 Thread Darren Williams
Hi Ingo On Mon, 17 Jan 2005, Ingo Molnar wrote: * Andrew Morton [EMAIL PROTECTED] wrote: +BUILD_LOCK_OPS(spin, spinlock_t, spin_is_locked); +BUILD_LOCK_OPS(read, rwlock_t, rwlock_is_locked); +BUILD_LOCK_OPS(write, rwlock_t, spin_is_locked); If you replace the last line with

Re: Horrible regression with -CURRENT from Don't busy-lock-loop in preemptable spinlocks patch

2005-01-17 Thread Darren Williams
On Tue, 18 Jan 2005, Darren Williams wrote: Hi Ingo On Mon, 17 Jan 2005, Ingo Molnar wrote: * Andrew Morton [EMAIL PROTECTED] wrote: +BUILD_LOCK_OPS(spin, spinlock_t, spin_is_locked); +BUILD_LOCK_OPS(read, rwlock_t, rwlock_is_locked); +BUILD_LOCK_OPS(write, rwlock_t,

Re: Horrible regression with -CURRENT from Don't busy-lock-loop in preemptable spinlocks patch

2005-01-17 Thread Chris Wedgwood
On Tue, Jan 18, 2005 at 03:28:58PM +1100, Darren Williams wrote: On top of Ingo's patch I attempt a solution that failed: +#define read_is_locked(x)(*(volatile int *) (x) 0) +#define write_is_locked(x) (*(volatile int *) (x) 0) how about something like: #define read_is_locked(x)

Re: Horrible regression with -CURRENT from "Don't busy-lock-loop in preemptable spinlocks" patch

2005-01-16 Thread Paul Mackerras
Chris Wedgwood writes: > +#define rwlock_is_write_locked(x) ((x)->lock == 0) AFAICS on i386 the lock word, although it goes to 0 when write-locked, can then go negative temporarily when another cpu tries to get a read or write lock. So I think this should be ((signed int)(x)->lock <= 0) (or

Re: Horrible regression with -CURRENT from "Don't busy-lock-loop in preemptable spinlocks" patch

2005-01-16 Thread Chris Wedgwood
On Sun, Jan 16, 2005 at 11:09:22PM -0800, Andrew Morton wrote: > If you replace the last line with > > BUILD_LOCK_OPS(write, rwlock_t, rwlock_is_locked); > > does it help? Paul noticed that too so I came up with the patch below. If it makes sense I can do the other architectures (I'm not

Re: Horrible regression with -CURRENT from "Don't busy-lock-loop in preemptable spinlocks" patch

2005-01-16 Thread Andrew Morton
Chris Wedgwood <[EMAIL PROTECTED]> wrote: > > Linus, > > The change below is causing major problems for me on a dual K7 with > CONFIG_PREEMPT enabled (cset -x and rebuilding makes the machine > usable again). > > ... > +BUILD_LOCK_OPS(spin, spinlock_t, spin_is_locked); > +BUILD_LOCK_OPS(read,

Horrible regression with -CURRENT from "Don't busy-lock-loop in preemptable spinlocks" patch

2005-01-16 Thread Chris Wedgwood
Linus, The change below is causing major problems for me on a dual K7 with CONFIG_PREEMPT enabled (cset -x and rebuilding makes the machine usable again). This change was merged a couple of days ago so I'm surprised nobody else has reported this. I tried to find where this patch came from but I

Horrible regression with -CURRENT from Don't busy-lock-loop in preemptable spinlocks patch

2005-01-16 Thread Chris Wedgwood
Linus, The change below is causing major problems for me on a dual K7 with CONFIG_PREEMPT enabled (cset -x and rebuilding makes the machine usable again). This change was merged a couple of days ago so I'm surprised nobody else has reported this. I tried to find where this patch came from but I

Re: Horrible regression with -CURRENT from Don't busy-lock-loop in preemptable spinlocks patch

2005-01-16 Thread Andrew Morton
Chris Wedgwood [EMAIL PROTECTED] wrote: Linus, The change below is causing major problems for me on a dual K7 with CONFIG_PREEMPT enabled (cset -x and rebuilding makes the machine usable again). ... +BUILD_LOCK_OPS(spin, spinlock_t, spin_is_locked); +BUILD_LOCK_OPS(read, rwlock_t,

Re: Horrible regression with -CURRENT from Don't busy-lock-loop in preemptable spinlocks patch

2005-01-16 Thread Chris Wedgwood
On Sun, Jan 16, 2005 at 11:09:22PM -0800, Andrew Morton wrote: If you replace the last line with BUILD_LOCK_OPS(write, rwlock_t, rwlock_is_locked); does it help? Paul noticed that too so I came up with the patch below. If it makes sense I can do the other architectures (I'm not sure

Re: Horrible regression with -CURRENT from Don't busy-lock-loop in preemptable spinlocks patch

2005-01-16 Thread Paul Mackerras
Chris Wedgwood writes: +#define rwlock_is_write_locked(x) ((x)-lock == 0) AFAICS on i386 the lock word, although it goes to 0 when write-locked, can then go negative temporarily when another cpu tries to get a read or write lock. So I think this should be ((signed int)(x)-lock = 0) (or the