linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Hugh Dickins <hughd@google.com>
To: Peter Xu <peterx@redhat.com>
Cc: Axel Rasmussen <axelrasmussen@google.com>,
	 LKML <linux-kernel@vger.kernel.org>,
	Linux MM <linux-mm@kvack.org>,
	 Andrew Morton <akpm@linux-foundation.org>,
	 Andrea Arcangeli <aarcange@redhat.com>,
	Hugh Dickins <hughd@google.com>,
	 Nadav Amit <nadav.amit@gmail.com>
Subject: Re: [PATCH] mm/khugepaged: Detecting uffd-wp vma more efficiently
Date: Wed, 22 Sep 2021 16:18:09 -0700 (PDT)	[thread overview]
Message-ID: <24224366-293a-879-95db-f69abcb0cb70@google.com> (raw)
In-Reply-To: <YUueOUfoamxOvEyO@t490s>

On Wed, 22 Sep 2021, Peter Xu wrote:
> 
> Not installing pmd means uffd-minor can still trap any further faults just like
> before, afaiu.
> 
> There's a very trivial detail that the pmd missing case will have a very slight
> code path change when the next page fault happens: in __handle_mm_fault() we'll
> first try to go into create_huge_pmd() once, however since shmem didn't provide
> huge_fault(), we'll go the VM_FAULT_FALLBACK path, and things will go like
> before when faulting on a small pte.  The next UFFDIO_CONTINUE will allocate
> that missing pmd again, however it'll install a 4K page only.

I think you're mistaken there.

I can't tell you much about ->huge_fault(), something introduced for
DAX I believe; but shmem has managed pmd mappings without it, since
before ->huge_fault() was ever added.

Look for the call to do_set_pmd() in finish_fault(): I think you'll
find that is the way shmem's huge pmds get in.

Earlier in the thread you suggested "shmem_getpage() only returns
small pages": but it can very well return PageTransCompound pages,
head or tail, which arrive at this do_set_pmd().

Hugh


  reply	other threads:[~2021-09-22 23:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-22 17:51 [PATCH] mm/khugepaged: Detecting uffd-wp vma more efficiently Peter Xu
2021-09-22 18:21 ` David Hildenbrand
2021-09-22 18:58   ` Peter Xu
2021-09-22 19:29     ` Yang Shi
2021-09-22 20:04       ` Peter Xu
2021-09-22 20:23         ` Peter Xu
2021-09-24 10:05     ` David Hildenbrand
2021-09-22 19:33 ` Peter Xu
2021-09-22 20:49 ` Axel Rasmussen
2021-09-22 21:20   ` Peter Xu
2021-09-22 23:18     ` Hugh Dickins [this message]
2021-09-22 23:44       ` Peter Xu
2021-09-23  1:22         ` Hugh Dickins
2021-09-23  2:18           ` Peter Xu
2021-09-23 16:47             ` Axel Rasmussen
2021-09-23 17:53               ` Peter Xu

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=24224366-293a-879-95db-f69abcb0cb70@google.com \
    --to=hughd@google.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=axelrasmussen@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=nadav.amit@gmail.com \
    --cc=peterx@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;
as well as URLs for NNTP newsgroup(s).