lkml.org 
[lkml]   [2010]   [Aug]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Xen-devel] [PATCH RFC 03/12] x86/ticketlock: Use C for __ticket_spin_unlock
On 07/20/2010 09:17 AM, Jeremy Fitzhardinge wrote:
>
> "volatile" would be a compiler barrier, but it has no direct effect on,
> or relevence to, the CPU. It just cares about the LOCK_PREFIX. The
> "memory" clobber is probably unnecessary as well, since the constraints
> already tell the compiler the most important information. We can add
> barriers separately as needed.
>

You absolutely need volatile, since otherwise you're permitting the
compiler to split, re-execute or even drop the code. Anything else
might work, by accident, but it's not clean.

-hpa

--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.



\
 
 \ /
  Last update: 2010-08-06 19:55    [W:0.098 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site