login
Header Space

 
 

Re: [PATCH 6/8] i386: bitops: Don't mark memory as clobbered unnecessarily

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linus Torvalds <torvalds@...>
Cc: Satyam Sharma <ssatyam@...>, Linux Kernel Mailing List <linux-kernel@...>, David Howells <dhowells@...>, Nick Piggin <nickpiggin@...>, Andi Kleen <ak@...>, Andrew Morton <akpm@...>
Date: Tuesday, July 24, 2007 - 5:36 pm

On Tue, 2007-07-24 at 10:24 -0700, Linus Torvalds wrote:

Well, as I said, our test_and_set_bit() asm (and in general, the asm for
all the atomic ops that -return- a value) have at least some level of
barriers in them because of that. We do that because people are abusing
them as locks. The smp_mb__after_set_bit() I never quite grokked. We do
an mb in there but I suspect we don't need if it's only ever used after
test_and_set_bit() because of the above. The smb_mb__before_clear_bit()
makes more sense as it's supposed to give clear_bit() a spin_unlock
semantic.

But we do need the "memory" clobber as well.

That's one reason why I like Nick's bitop locks patches, providing
-explicit- test_and_set_bit_lock() and clear_bit_unlock(), we can fix a
whole lot of things and make sure they have the right barriers and not
more. (We save a few useless barriers on POWER that way in the page lock
path and it's measureable in his benchmark).

Cheers,
Ben.



-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/8] i386: bitops: Cleanup, sanitize, optimize, Satyam Sharma, (Mon Jul 23, 12:05 pm)
Re: [PATCH 0/8] i386: bitops: Cleanup, sanitize, optimize, Denis Vlasenko, (Mon Jul 30, 1:57 pm)
Re: [PATCH 0/8] i386: bitops: Cleanup, sanitize, optimize, Satyam Sharma, (Mon Jul 30, 9:07 pm)
Re: [PATCH 4/8] i386: bitops: Kill volatile-casting of memor..., Benjamin Herrenschmidt, (Tue Jul 24, 5:49 am)
[PATCH 3/8] i386: bitops: Rectify bogus "+m" constraints, Satyam Sharma, (Mon Jul 23, 12:05 pm)
[PATCH 2/8] i386: bitops: Rectify bogus "Ir" constraints, Satyam Sharma, (Mon Jul 23, 12:05 pm)
Re: [PATCH 8/8] i386: bitops: smp_mb__{before, after}_clear_..., Jeremy Fitzhardinge, (Tue Jul 24, 3:48 am)
Re: [PATCH 6/8] i386: bitops: Don't mark memory as clobbered..., Jeremy Fitzhardinge, (Tue Jul 24, 5:31 pm)
Re: [PATCH 6/8] i386: bitops: Don't mark memory as clobbered..., Benjamin Herrenschmidt, (Tue Jul 24, 5:52 am)
Re: [PATCH 6/8] i386: bitops: Don't mark memory as clobbered..., Benjamin Herrenschmidt, (Tue Jul 24, 5:36 pm)
Re: [PATCH 6/8] i386: bitops: Don't mark memory as clobbered..., Benjamin Herrenschmidt, (Tue Jul 24, 5:37 pm)
Re: [PATCH 6/8] i386: bitops: Don't mark memory as clobbered..., Benjamin Herrenschmidt, (Tue Jul 24, 6:32 pm)
Re: [PATCH 6/8] i386: bitops: Don't mark memory as clobbered..., Jeremy Fitzhardinge, (Mon Jul 23, 1:49 pm)
[PATCH 1/8] i386: bitops: Update/correct comments, Satyam Sharma, (Mon Jul 23, 12:05 pm)
Re: [PATCH 7/8] i386: bitops: Kill needless usage of __asm__..., Jeremy Fitzhardinge, (Mon Jul 23, 12:23 pm)
Re: [PATCH 7/8] i386: bitops: Kill needless usage of __asm__..., Jeremy Fitzhardinge, (Mon Jul 23, 1:39 pm)
Re: [PATCH 7/8] i386: bitops: Kill needless usage of __asm__..., Jeremy Fitzhardinge, (Mon Jul 23, 2:28 pm)
Re: [PATCH 7/8] i386: bitops: Kill needless usage of __asm__..., Jeremy Fitzhardinge, (Mon Jul 23, 4:40 pm)
speck-geostationary