Re: [patch 134/149] x86, paravirt: Add a global synchronization point for pvclock

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linus Torvalds
Date: Tuesday, July 13, 2010 - 10:59 am

On Tue, Jul 13, 2010 at 10:50 AM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:

Btw, this second patch was a bit more aggressive than the first one,
and actually removes the "memory" clobber entirely, and the fake cast
of the target type.

That shouldn't matter _except_ if people actually use cmpxchg to
implement their own locking, since now the compiler could potentially
move unrelated memory references around the lock. Of course, if you
use cmpxchg to implement your own locking, you're probably doing
something wrong anyway (ie you'll get the wrong memory barriers on
various architectures), so it should all be fine.

But I thought I'd mention it. And I don't really know how much gcc
moves memory accesses around a "asm volatile" - the gcc docs are
historically very vague ("volatile asms aren't moved around
'significantly'", whatever 'significant' means)

And btw, none of the above should be taken to mean that I have tested
the patch or found it to be otherwise good. It might be totally broken
for other reasons. Caveat emptor.

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

Messages in current thread:
Re: [patch 134/149] x86, paravirt: Add a global synchroniz ..., Linus Torvalds, (Tue Jul 13, 10:59 am)
Re: [patch 134/149] x86, paravirt: Add a global synchroniz ..., Jeremy Fitzhardinge, (Tue Jul 13, 11:21 am)
Re: [patch 134/149] x86, paravirt: Add a global synchroniz ..., Jeremy Fitzhardinge, (Tue Jul 13, 4:49 pm)
Re: [patch 134/149] x86, paravirt: Add a global synchroniz ..., Jeremy Fitzhardinge, (Wed Jul 14, 10:19 am)
Re: [patch 134/149] x86, paravirt: Add a global synchroniz ..., Jeremy Fitzhardinge, (Wed Jul 14, 10:34 am)
Re: [patch 134/149] x86, paravirt: Add a global synchroniz ..., Jeremy Fitzhardinge, (Wed Jul 14, 10:57 am)
Re: [patch 134/149] x86, paravirt: Add a global synchroniz ..., Jeremy Fitzhardinge, (Wed Jul 14, 11:15 am)
Re: [patch 134/149] x86, paravirt: Add a global synchroniz ..., Jeremy Fitzhardinge, (Wed Jul 14, 1:40 pm)
Re: [patch 134/149] x86, paravirt: Add a global synchroniz ..., Jeremy Fitzhardinge, (Wed Jul 14, 1:58 pm)
Re: [patch 134/149] x86, paravirt: Add a global synchroniz ..., Jeremy Fitzhardinge, (Wed Jul 14, 2:11 pm)
Re: [patch 134/149] x86, paravirt: Add a global synchroniz ..., Jeremy Fitzhardinge, (Wed Jul 14, 2:11 pm)
Re: [patch 134/149] x86, paravirt: Add a global synchroniz ..., Jeremy Fitzhardinge, (Wed Jul 14, 2:11 pm)
Re: [patch 134/149] x86, paravirt: Add a global synchroniz ..., Jeremy Fitzhardinge, (Tue Jul 27, 10:46 am)
xchg() and cmpxchg(), H. Peter Anvin, (Tue Jul 27, 4:57 pm)
[tip:x86/urgent] x86: Add memory modify constraints to xch ..., tip-bot for H. Peter ..., (Tue Jul 27, 10:33 pm)
[tip:x86/asm] x86, asm: Clean up and simplify &lt;asm/cmpxchg.h&gt;, tip-bot for H. Peter ..., (Wed Jul 28, 4:28 pm)
[tip:x86/asm] x86, asm: Move cmpxchg emulation code to arc ..., tip-bot for H. Peter ..., (Thu Jul 29, 1:12 pm)
[tip:x86/asm] x86, asm: Merge cmpxchg_486_u64() and cmpxch ..., tip-bot for H. Peter ..., (Thu Jul 29, 1:13 pm)
Re: [tip:x86/urgent] x86: Add memory modify constraints to ..., Jeremy Fitzhardinge, (Mon Aug 2, 4:51 pm)
Re: [stable] [tip:x86/urgent] x86: Add memory modify const ..., Tomáš Janoušek, (Thu Sep 9, 12:53 pm)
Re: [stable] [tip:x86/urgent] x86: Add memory modify const ..., Tomáš Janoušek, (Thu Sep 9, 2:09 pm)
Re: [stable] [tip:x86/urgent] x86: Add memory modify const ..., Tomáš Janoušek, (Fri Sep 10, 6:10 am)
Re: [stable] [tip:x86/urgent] x86: Add memory modify const ..., Tomáš Janoušek, (Fri Sep 24, 12:17 am)