From: Peter Zijlstra <peterz@infradead.org>
To: Andrea Arcangeli <aarcange@redhat.com>
Cc: Rik van Riel <riel@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
paulmck <paulmck@linux.vnet.ibm.com>,
Oleg Nesterov <oleg@redhat.com>,
linux-kernel <linux-kernel@vger.kernel.org>,
Hugh Dickins <hughd@google.com>
Subject: Re: thp and memory barrier assumptions
Date: Thu, 26 Jul 2012 22:33:25 +0200 [thread overview]
Message-ID: <1343334805.32120.13.camel@twins> (raw)
In-Reply-To: <1343334698.32120.11.camel@twins>
On Thu, 2012-07-26 at 22:31 +0200, Peter Zijlstra wrote:
> __do_huge_pmd_anonymous_page() contains:
>
> /*
> * The spinlocking to take the lru_lock inside
> * page_add_new_anon_rmap() acts as a full memory
> * barrier to be sure clear_huge_page writes become
> * visible after the set_pmd_at() write.
> */
> page_add_new_anon_rmap(page, vma, haddr);
>
>
> page_add_new_anon_rmap() doesn't look to actually do a LOCK+UNLOCK
> except for unevictable pages.
>
> But even if it did do an unconditional LOCK+UNLOCK that doesn't make a
> full memory barrier, see Documentation/memory-barriers.txt.
>
> In particular:
>
> *A = a;
> LOCK
> UNLOCK
> *B = b;
>
> may occur as:
>
> LOCK, STORE *B, STORE *A, UNLOCK
>
Also, what is that barrier() in handle_mm_fault() doing? And why doesn't
it have a comment explaining that?
next prev parent reply other threads:[~2012-07-26 20:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-26 20:31 thp and memory barrier assumptions Peter Zijlstra
2012-07-26 20:33 ` Peter Zijlstra [this message]
2012-08-03 19:30 ` Andrea Arcangeli
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=1343334805.32120.13.camel@twins \
--to=peterz@infradead.org \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg@redhat.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=riel@redhat.com \
/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