linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Axel Rasmussen <axelrasmussen@google.com>
To: Peter Xu <peterx@redhat.com>
Cc: Hugh Dickins <hughd@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>,
	Nadav Amit <nadav.amit@gmail.com>
Subject: Re: [PATCH] mm/khugepaged: Detecting uffd-wp vma more efficiently
Date: Thu, 23 Sep 2021 09:47:42 -0700	[thread overview]
Message-ID: <CAJHvVcg=oQBcuFjT_RO-_0VMtmyTzkzmUaUv0-zX42CnRWbBAg@mail.gmail.com> (raw)
In-Reply-To: <YUvj9r3Y954pYPnf@xz-m1.local>

On Wed, Sep 22, 2021 at 7:18 PM Peter Xu <peterx@redhat.com> wrote:
>
> On Wed, Sep 22, 2021 at 06:22:45PM -0700, Hugh Dickins wrote:
> > No, I think I misunderstood you before: thanks for re-explaining.
> > (And Axel's !userfaultfd_minor() check before calling do_fault_around()
> > plays an important part in making sure that it does reach shmem_fault().)
>
> Still thanks for confirming this, Hugh.
>
> Said that, Axel, I didn't mean I'm against doing something similar like
> uffd-wp; it's just a heads-up that maybe you won't find a reproducer with real
> issues with minor mode.
>
> Even if I think minor mode should be fine with current code, we could still
> choose to disable khugepaged from removing the pmd for VM_UFFD_MINOR vmas, just
> like what we'll do with VM_UFFD_WP.  At least it can still reduce false
> positives.
>
> So far in my local branch I queued the patch which I attached, that's required
> for uffd-wp shmem afaict.  If you think minor mode would like that too, I can
> post it separately with minor mode added in.

No worries, you can leave the minor fault case to me.

My thinking there was a THP collapse bug was really just based on
speculation, not a real reproducer, so it's very possible my
speculation was wrong. It will take some more thinking and reading to
convince myself one way or the other. :) Thanks to you and Hugh for
all the details.

I'd prefer not to add this fix "just in case", if it isn't a real
problem, as it seems like it may confuse future readers of the code.

I'll send out a patch for it if / when I manage to build a real
reproducer. Or, in the meantime, some of my Google colleagues are
testing this code via their live migration implementation, so if there
is a bug here there's a good chance we'll find it that way too.

>
> Note that it's slightly different from what I pasted in reply to Yang Shi - I
> made it slightly more complicated just to make sure there's no race.  I
> mentioned the possible race (I think) in the commit log.
>
> Let me know your preference.
>
> Thanks,
>
> --
> Peter Xu


  reply	other threads:[~2021-09-23 16:48 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-22 17:51 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
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 [this message]
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='CAJHvVcg=oQBcuFjT_RO-_0VMtmyTzkzmUaUv0-zX42CnRWbBAg@mail.gmail.com' \
    --to=axelrasmussen@google.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hughd@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