linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: "Jia He" <justin.he@arm.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Jérôme Glisse" <jglisse@redhat.com>,
	"Ralph Campbell" <rcampbell@nvidia.com>,
	"Jason Gunthorpe" <jgg@ziepe.ca>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Dave Airlie" <airlied@redhat.com>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>,
	"Thomas Hellstrom" <thellstrom@vmware.com>,
	"Souptick Joarder" <jrdr.linux@gmail.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] mm: fix double page fault on arm64 if PTE_AF is cleared
Date: Tue, 10 Sep 2019 10:15:15 +0100	[thread overview]
Message-ID: <20190910091515.GE14442@C02TF0J2HF1T.local> (raw)
In-Reply-To: <20190906145742.GX29434@bombadil.infradead.org>

On Fri, Sep 06, 2019 at 07:57:42AM -0700, Matthew Wilcox wrote:
> On Fri, Sep 06, 2019 at 09:57:47PM +0800, Jia He wrote:
> >  		 * This really shouldn't fail, because the page is there
> >  		 * in the page tables. But it might just be unreadable,
> >  		 * in which case we just give up and fill the result with
> > -		 * zeroes.
> > +		 * zeroes. If PTE_AF is cleared on arm64, it might
> > +		 * cause double page fault. So makes pte young here
> 
> How about:
> 		 * zeroes. On architectures with software "accessed" bits,
> 		 * we would take a double page fault here, so mark it
> 		 * accessed here.
> 
> >  		 */
> > +		if (!pte_young(vmf->orig_pte)) {
> 
> Let's guard this with:
> 
> 		if (arch_sw_access_bit && !pte_young(vmf->orig_pte)) {
> 
> #define arch_sw_access_bit	0
> by default and have arm64 override it (either to a variable or a constant
> ... your choice).  Also, please somebody decide on a better name than
> arch_sw_access_bit.

I'm not good at names either (is arch_faults_on_old_pte any better?) but
I'd make this a 0 args call: arch_sw_access_bit(). This way we can make
it a static inline function on arm64 with some static label check.

-- 
Catalin

  reply	other threads:[~2019-09-10  9:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-06 13:57 [PATCH v2] mm: fix double page fault on arm64 if PTE_AF is cleared Jia He
2019-09-06 14:57 ` Matthew Wilcox
2019-09-10  9:15   ` Catalin Marinas [this message]
2019-09-09 21:27 ` Matthew Wilcox
2019-09-10  9:08   ` Catalin Marinas
2019-09-10  9:29 ` Kirill A. Shutemov

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=20190910091515.GE14442@C02TF0J2HF1T.local \
    --to=catalin.marinas@arm.com \
    --cc=airlied@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=jgg@ziepe.ca \
    --cc=jglisse@redhat.com \
    --cc=jrdr.linux@gmail.com \
    --cc=justin.he@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=peterz@infradead.org \
    --cc=rcampbell@nvidia.com \
    --cc=thellstrom@vmware.com \
    --cc=willy@infradead.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).