Re: [patch, 2.6.10-rc2] sched: fix ->nr_uninterruptible handling bugs

2005-01-27 Thread Andi Kleen
Ingo Molnar <[EMAIL PROTECTED]> writes: > > interestingly, the x86 spinlock implementation uses a LOCK-ed > instruction only on acquire - it uses a simple atomic write (and > implicit barrier assumption) on the way out: > > #define spin_unlock_string \ > "movb $1,%0" \ >

Re: [patch, 2.6.10-rc2] sched: fix ->nr_uninterruptible handling bugs

2005-01-27 Thread Paul Jackson
Ingo wrote: > if by 'some CPUs' you mean x86 then it's the LOCK prefixed ops ... Yup - that's the one. Thanks. -- I won't rest till it's the best ... Programmer, Linux Scalability Paul Jackson <[EMAIL PROTECTED]> 1.650.933.1373, 1.925.600.0

Re: [patch, 2.6.10-rc2] sched: fix ->nr_uninterruptible handling bugs

2005-01-27 Thread Ingo Molnar
* Paul Jackson <[EMAIL PROTECTED]> wrote: > A long time ago, Linus wrote: > > An atomic op is pretty much as expensive as a spinlock/unlock pair on x86. > > Not _quite_, but it's pretty close. > > Are both read and modify atomic ops relatively expensive on some CPUs, > or is it just modify ato

Re: [patch, 2.6.10-rc2] sched: fix ->nr_uninterruptible handling bugs

2005-01-27 Thread Paul Jackson
True - thanks - including the part about the cost of locking bugs. My question was poorly phrased - the code speaks the answer to the real question I had: $ grep define.atomic_ include/asm-ia64/atomic.h | head -2 #define atomic_read(v) ((v)->counter) #define atomic_set(v,i)

Re: [patch, 2.6.10-rc2] sched: fix ->nr_uninterruptible handling bugs

2005-01-27 Thread Linus Torvalds
On Thu, 27 Jan 2005, Paul Jackson wrote: > > A long time ago, Linus wrote: > > An atomic op is pretty much as expensive as a spinlock/unlock pair on x86. > > Not _quite_, but it's pretty close. > > Are both read and modify atomic ops relatively expensive on some CPUs, > or is it just modify at

Re: [patch, 2.6.10-rc2] sched: fix ->nr_uninterruptible handling bugs

2005-01-27 Thread Paul Jackson
A long time ago, Linus wrote: > An atomic op is pretty much as expensive as a spinlock/unlock pair on x86. > Not _quite_, but it's pretty close. Are both read and modify atomic ops relatively expensive on some CPUs, or is it just modify atomic ops? (Ignoring for this question the possibility th