linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Rik van Riel <riel@redhat.com>
To: Andrea Arcangeli <aarcange@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, Johannes Weiner <jweiner@redhat.com>,
	Hugh Dickins <hughd@google.com>, Mel Gorman <mgorman@suse.de>
Subject: Re: [PATCH] mm: thp: fix pmd_present for split_huge_page and PROT_NONE with THP
Date: Wed, 19 Sep 2012 10:15:03 -0400	[thread overview]
Message-ID: <5059D367.7020801@redhat.com> (raw)
In-Reply-To: <1348005959-4869-1-git-send-email-aarcange@redhat.com>

On 09/18/2012 06:05 PM, Andrea Arcangeli wrote:
> In many places !pmd_present has been converted to pmd_none. For pmds
> that's equivalent and pmd_none is quicker so using pmd_none is
> better.
>
> However (unless we delete pmd_present) we should provide an accurate
> pmd_present too. This will avoid the risk of code thinking the pmd is
> non present because it's under __split_huge_page_map, see the
> pmd_mknotpresent there and the comment above it.
>
> If the page has been mprotected as PROT_NONE, it would also lead to a
> pmd_present false negative in the same way as the race with
> split_huge_page.
>
> Because the PSE bit stays on at all times (both during split_huge_page
> and when the _PAGE_PROTNONE bit get set), we could only check for the
> PSE bit, but checking the PROTNONE bit too is still good to remember
> pmd_present must always keep PROT_NONE into account.
 >
> This explains a not reproducible BUG_ON that was seldom reported on
> the lists.
>
> The same issue is in pmd_large, it would go wrong with both PROT_NONE
> and if it races with split_huge_page.
>
> Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>

Acked-by: Rik van Riel <riel@redhat.com>

--
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:[~2012-09-19 14:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-18 22:05 [PATCH] mm: thp: fix pmd_present for split_huge_page and PROT_NONE with THP Andrea Arcangeli
2012-09-19 14:15 ` Rik van Riel [this message]

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=5059D367.7020801@redhat.com \
    --to=riel@redhat.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hughd@google.com \
    --cc=jweiner@redhat.com \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    /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;
as well as URLs for NNTP newsgroup(s).