All of lore.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: paulmck@linux.vnet.ibm.com
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	linux-kernel@vger.kernel.org
Subject: Re: sequence lock in Linux
Date: Fri, 11 Jun 2010 15:41:00 -0700	[thread overview]
Message-ID: <4C12BB7C.1040408@zytor.com> (raw)
In-Reply-To: <20100611220443.GJ2394@linux.vnet.ibm.com>

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


  reply	other threads:[~2010-06-11 22:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-11 19:40 sequence lock in Linux Mathieu Desnoyers
2010-06-11 20:07 ` Paul E. McKenney
2010-06-11 20:46   ` Mathieu Desnoyers
2010-06-11 20:07 ` Linus Torvalds
2010-06-11 20:36   ` Paul E. McKenney
2010-06-11 21:06     ` H. Peter Anvin
2010-06-11 21:36       ` Paul E. McKenney
2010-06-11 21:38         ` H. Peter Anvin
2010-06-11 22:04           ` Paul E. McKenney
2010-06-11 22:41             ` H. Peter Anvin [this message]
2010-06-11 21:09   ` Mathieu Desnoyers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C12BB7C.1040408@zytor.com \
    --to=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.