linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
	benh@kernel.crashing.org, paulus@samba.org
Cc: linuxppc-dev@lists.ozlabs.org,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Subject: Re: powerpc/mm: Differentiate between hugetlb and THP during page walk
Date: Mon, 12 Oct 2015 22:17:21 +1100 (AEDT)	[thread overview]
Message-ID: <20151012111721.92EAE140D8F@ozlabs.org> (raw)
In-Reply-To: <1444359741-3037-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>

On Fri, 2015-09-10 at 03:02:21 UTC, "Aneesh Kumar K.V" wrote:
> We need to properly identify whether a hugepage is an explicit or
> a transparent hugepage in follow_huge_addr(). We used to depend
> on hugepage shift argument to do that. But in some case that can
> result in wrong results. For ex:
> 
> On finding a transparent hugepage we set hugepage shift to PMD_SHIFT.
> But we can end up clearing the thp pte, via pmdp_huge_get_and_clear.
> We do prevent reusing the pfn page via the usage of
> kick_all_cpus_sync(). But that happens after we updated the pte to 0.
> Hence in follow_huge_addr() we can find hugepage shift set, but transparent
> huge page check fail for a thp pte.
> 
> NOTE: We fixed a variant of this race against thp split in commit
> 691e95fd7396905a38d98919e9c150dbc3ea21a3
> ("powerpc/mm/thp: Make page table walk safe against thp split/collapse")
> 
> Without this patch, we may hit the BUG_ON(flags & FOLL_GET) in
> follow_page_mask occasionally.
> 
> In the long term, we may want to switch ppc64 64k page size config to
> enable CONFIG_ARCH_WANT_GENERAL_HUGETLB
> 
> Reported-by: David Gibson <david@gibson.dropbear.id.au>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/891121e6c02c6242487aa4ea

cheers

      reply	other threads:[~2015-10-12 11:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-09  3:02 [PATCH] powerpc/mm: Differentiate between hugetlb and THP during page walk Aneesh Kumar K.V
2015-10-12 11:17 ` Michael Ellerman [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=20151012111721.92EAE140D8F@ozlabs.org \
    --to=mpe@ellerman.id.au \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=paulus@samba.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 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).