lkml.org 
[lkml]   [2010]   [Jun]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: sequence lock in Linux
On 06/11/2010 03:04 PM, Paul E. McKenney wrote:
> On Fri, Jun 11, 2010 at 02:38:59PM -0700, H. Peter Anvin wrote:
>> On 06/11/2010 02:36 PM, Paul E. McKenney wrote:
>>> Memory barriers in the sequence-lock code prevent this, assuming, as
>>> you point out, that memory clobber works (but if it doesn't, it should
>>> be fixed):
>>
>> The constness is my main concern. It's not clear to me that "memory" is
>> meant to imply that const memory areas without volatile can be clobbered.
>
> Ah! I was assuming that gcc treated "memory" as it would an call to
> a function in some other compilation unit. In that case, the compiler
> could not count on the "const" on the argument, given the possibility
> that the called function might gain a reference to the same memory
> locations in a non-const manner, right?
>
> Thanx, Paul

Right.

-hpa



\
 
 \ /
  Last update: 2010-06-12 00:43    [W:0.207 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site