Re: [PATCH 8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions

2007-07-24 Thread Satyam Sharma
On Tue, 24 Jul 2007, Linus Torvalds wrote: > On Tue, 24 Jul 2007, Satyam Sharma wrote: > > > > Looks like when you said "CPU memory barrier extends to all memory > > references" you were probably referring to a _given_ CPU ... yes, > > that statement is correct in that case. > > No. CPU memory

Re: [PATCH 8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions

2007-07-24 Thread Linus Torvalds
On Tue, 24 Jul 2007, Satyam Sharma wrote: > > Looks like when you said "CPU memory barrier extends to all memory > references" you were probably referring to a _given_ CPU ... yes, > that statement is correct in that case. No. CPU memory barriers extend to all CPU's. End of discussion. It's

Re: [PATCH 8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions

2007-07-24 Thread Nick Piggin
Satyam Sharma wrote: On Tue, 24 Jul 2007, Nick Piggin wrote: Are you saying that it is OK for the store to var to be reordered below the clear_bit? If not, what are you saying? I might be making a radical turn-around here, but all of a sudden I think it's actually a good idea to put a

Re: [PATCH 8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions

2007-07-24 Thread Satyam Sharma
On Tue, 24 Jul 2007, Nick Piggin wrote: > > > For the purpose of this discussion (Linux memory > > > barrier semantics, on WB memory), it is true of CPU > > > and compiler barriers. > > > > On later Intel processors, if the memory address range being referenced > > (and say written to) by the

Re: [PATCH 8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions

2007-07-24 Thread Nick Piggin
Satyam Sharma wrote: On Tue, 24 Jul 2007, Nick Piggin wrote: For the purpose of this discussion (Linux memory barrier semantics, on WB memory), it is true of CPU and compiler barriers. On later Intel processors, if the memory address range being referenced (and say written to) by the

Re: [PATCH 8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions

2007-07-24 Thread Satyam Sharma
On Tue, 24 Jul 2007, Nick Piggin wrote: > > > Satyam Sharma wrote: > > > > > Consider this (the above two functions exist > > only for clear_bit(), > > > > the atomic variant, as you already know), the > > _only_ memory reference > > > > we care about is that of the address of the > > passed

Re: [PATCH 8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions

2007-07-24 Thread Nick Piggin
--- Satyam Sharma <[EMAIL PROTECTED]> wrote: > On Tue, 24 Jul 2007, Nick Piggin wrote: > > > Satyam Sharma wrote: > > > Consider this (the above two functions exist > only for clear_bit(), > > > the atomic variant, as you already know), the > _only_ memory reference > > > we care about is that

Re: [PATCH 8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions

2007-07-24 Thread Satyam Sharma
On Tue, 24 Jul 2007, Nick Piggin wrote: > Satyam Sharma wrote: > > On Tue, 24 Jul 2007, Nick Piggin wrote: > > > Satyam Sharma wrote: > > > [...] > > > > So let's make these proper no-ops, because that's exactly what we > > > > require > > > > these to be on the i386 platform. > > > > > > No.

Re: [PATCH 8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions

2007-07-24 Thread Nick Piggin
Jeremy Fitzhardinge wrote: Satyam Sharma wrote: Consider this (the above two functions exist only for clear_bit(), the atomic variant, as you already know), the _only_ memory reference we care about is that of the address of the passed bit-string: (1) The compiler must not optimize / elid it

Re: [PATCH 8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions

2007-07-24 Thread Nick Piggin
Satyam Sharma wrote: On Tue, 24 Jul 2007, Nick Piggin wrote: Satyam Sharma wrote: From: Satyam Sharma <[EMAIL PROTECTED]> [8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions From Documentation/atomic_ops.txt, those archs that require explicit memory barriers around

Re: [PATCH 8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions

2007-07-24 Thread Jeremy Fitzhardinge
Satyam Sharma wrote: > Consider this (the above two functions exist only for clear_bit(), > the atomic variant, as you already know), the _only_ memory reference > we care about is that of the address of the passed bit-string: > > (1) The compiler must not optimize / elid it (i.e. we need to

Re: [PATCH 8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions

2007-07-24 Thread Satyam Sharma
On Tue, 24 Jul 2007, Nick Piggin wrote: > Satyam Sharma wrote: > > From: Satyam Sharma <[EMAIL PROTECTED]> > > > > [8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions > > > > > From Documentation/atomic_ops.txt, those archs that require explicit > > memory barriers around

Re: [PATCH 8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions

2007-07-24 Thread Satyam Sharma
On Tue, 24 Jul 2007, Nick Piggin wrote: Satyam Sharma wrote: From: Satyam Sharma [EMAIL PROTECTED] [8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions From Documentation/atomic_ops.txt, those archs that require explicit memory barriers around clear_bit() must also

Re: [PATCH 8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions

2007-07-24 Thread Jeremy Fitzhardinge
Satyam Sharma wrote: Consider this (the above two functions exist only for clear_bit(), the atomic variant, as you already know), the _only_ memory reference we care about is that of the address of the passed bit-string: (1) The compiler must not optimize / elid it (i.e. we need to disallow

Re: [PATCH 8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions

2007-07-24 Thread Nick Piggin
Satyam Sharma wrote: On Tue, 24 Jul 2007, Nick Piggin wrote: Satyam Sharma wrote: From: Satyam Sharma [EMAIL PROTECTED] [8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions From Documentation/atomic_ops.txt, those archs that require explicit memory barriers around

Re: [PATCH 8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions

2007-07-24 Thread Nick Piggin
Jeremy Fitzhardinge wrote: Satyam Sharma wrote: Consider this (the above two functions exist only for clear_bit(), the atomic variant, as you already know), the _only_ memory reference we care about is that of the address of the passed bit-string: (1) The compiler must not optimize / elid it

Re: [PATCH 8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions

2007-07-24 Thread Satyam Sharma
On Tue, 24 Jul 2007, Nick Piggin wrote: Satyam Sharma wrote: On Tue, 24 Jul 2007, Nick Piggin wrote: Satyam Sharma wrote: [...] So let's make these proper no-ops, because that's exactly what we require these to be on the i386 platform. No. clear_bit is not a compiler

Re: [PATCH 8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions

2007-07-24 Thread Nick Piggin
--- Satyam Sharma [EMAIL PROTECTED] wrote: On Tue, 24 Jul 2007, Nick Piggin wrote: Satyam Sharma wrote: Consider this (the above two functions exist only for clear_bit(), the atomic variant, as you already know), the _only_ memory reference we care about is that of the address of

Re: [PATCH 8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions

2007-07-24 Thread Satyam Sharma
On Tue, 24 Jul 2007, Nick Piggin wrote: Satyam Sharma wrote: Consider this (the above two functions exist only for clear_bit(), the atomic variant, as you already know), the _only_ memory reference we care about is that of the address of the passed bit-string: No.

Re: [PATCH 8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions

2007-07-24 Thread Nick Piggin
Satyam Sharma wrote: On Tue, 24 Jul 2007, Nick Piggin wrote: For the purpose of this discussion (Linux memory barrier semantics, on WB memory), it is true of CPU and compiler barriers. On later Intel processors, if the memory address range being referenced (and say written to) by the

Re: [PATCH 8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions

2007-07-24 Thread Satyam Sharma
On Tue, 24 Jul 2007, Nick Piggin wrote: For the purpose of this discussion (Linux memory barrier semantics, on WB memory), it is true of CPU and compiler barriers. On later Intel processors, if the memory address range being referenced (and say written to) by the (locked)

Re: [PATCH 8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions

2007-07-24 Thread Nick Piggin
Satyam Sharma wrote: On Tue, 24 Jul 2007, Nick Piggin wrote: Are you saying that it is OK for the store to var to be reordered below the clear_bit? If not, what are you saying? I might be making a radical turn-around here, but all of a sudden I think it's actually a good idea to put a

Re: [PATCH 8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions

2007-07-24 Thread Linus Torvalds
On Tue, 24 Jul 2007, Satyam Sharma wrote: Looks like when you said CPU memory barrier extends to all memory references you were probably referring to a _given_ CPU ... yes, that statement is correct in that case. No. CPU memory barriers extend to all CPU's. End of discussion. It's not

Re: [PATCH 8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions

2007-07-24 Thread Satyam Sharma
On Tue, 24 Jul 2007, Linus Torvalds wrote: On Tue, 24 Jul 2007, Satyam Sharma wrote: Looks like when you said CPU memory barrier extends to all memory references you were probably referring to a _given_ CPU ... yes, that statement is correct in that case. No. CPU memory barriers

Re: [PATCH 8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions

2007-07-23 Thread Nick Piggin
Satyam Sharma wrote: From: Satyam Sharma <[EMAIL PROTECTED]> [8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions From Documentation/atomic_ops.txt, those archs that require explicit memory barriers around clear_bit() must also implement these two interfaces. However, for

[PATCH 8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions

2007-07-23 Thread Satyam Sharma
From: Satyam Sharma <[EMAIL PROTECTED]> [8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions >From Documentation/atomic_ops.txt, those archs that require explicit memory barriers around clear_bit() must also implement these two interfaces. However, for i386, clear_bit() is a

[PATCH 8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions

2007-07-23 Thread Satyam Sharma
From: Satyam Sharma [EMAIL PROTECTED] [8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions From Documentation/atomic_ops.txt, those archs that require explicit memory barriers around clear_bit() must also implement these two interfaces. However, for i386, clear_bit() is a strict,

Re: [PATCH 8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions

2007-07-23 Thread Nick Piggin
Satyam Sharma wrote: From: Satyam Sharma [EMAIL PROTECTED] [8/8] i386: bitops: smp_mb__{before, after}_clear_bit() definitions From Documentation/atomic_ops.txt, those archs that require explicit memory barriers around clear_bit() must also implement these two interfaces. However, for i386,