linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Hugh Dickins <hugh@veritas.com>, Mel Gorman <mel@skynet.ie>,
	Nick Piggin <npiggin@suse.de>,
	linux-mm@kvack.org
Subject: Re: [PATCH] Remove unnecessary smp_wmb from clear_user_highpage()
Date: Fri, 20 Jul 2007 14:57:48 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.0.999.0707201454560.27249@woody.linux-foundation.org> (raw)
In-Reply-To: <20070720210610.GA148@tv-sign.ru>


On Sat, 21 Jul 2007, Oleg Nesterov wrote:
> 
> Linus Torvalds wrote:
> >
> > A full lock/unlock *pair* should (as far as I know) always be equivalent 
> > to a full memory barrier.
> 
> Is it so? I am not arguing, I am trying to understand.

Yeah, no, I think you're right, and I'm wrong.

I think unlock+lock is a complete barrier, but lock+unlock isn't. Funny.

> This means that unlock + lock is a full barrier,

Indeed. If nothing else, because on the same lock it obviously had better 
be (you have two critical regions, and the whole *point* of the lock is to 
keep them clear of each others).

> > However, neither a "lock" nor an "unlock" on *its*own* is a barrier at 
> > all, at most they are semi-permeable barriers for some things, where 
> > different architectures can be differently semi-permeable.
> 
> and this means that lock + unlock is not.
> 
> 	A;
> 	lock();
> 	unlock();
> 	B;
> 
> If both A and B can leak into the critical section, they could be reordered
> inside this section, so we can have
> 
> 	lock();
> 	B;
> 	A;
> 	unlock();
> 
> Yes?

Yes, I think you're right.

		Linus

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2007-07-20 21:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-20 21:06 Oleg Nesterov
2007-07-20 21:57 ` Linus Torvalds [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-07-18 15:05 Mel Gorman
2007-07-18 16:45 ` Hugh Dickins
2007-07-19  2:17   ` Nick Piggin
2007-07-20 13:08     ` Mel Gorman
2007-07-23  2:02       ` Nick Piggin
2007-07-19  2:28   ` Linus Torvalds
2007-07-19  2:58     ` Nick Piggin
2007-07-19  2:36   ` Nick Piggin
2007-07-19 11:16   ` Mel Gorman
2007-07-19  1:57 ` Nick Piggin

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=alpine.LFD.0.999.0707201454560.27249@woody.linux-foundation.org \
    --to=torvalds@linux-foundation.org \
    --cc=hugh@veritas.com \
    --cc=linux-mm@kvack.org \
    --cc=mel@skynet.ie \
    --cc=npiggin@suse.de \
    --cc=oleg@tv-sign.ru \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox