linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Suren Baghdasaryan <surenb@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: torvalds@linux-foundation.org, jannh@google.com,
	willy@infradead.org,  liam.howlett@oracle.com, david@redhat.com,
	peterx@redhat.com,  ldufour@linux.ibm.com, vbabka@suse.cz,
	michel@lespinasse.org,  jglisse@google.com, mhocko@suse.com,
	hannes@cmpxchg.org, dave@stgolabs.net,  hughd@google.com,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	 stable@vger.kernel.org, kernel-team@android.com,
	 Linus Torvalds <torvalds@linuxfoundation.org>
Subject: Re: [PATCH v4 1/6] mm: enable page walking API to lock vmas during the walk
Date: Fri, 4 Aug 2023 12:41:23 -0700	[thread overview]
Message-ID: <CAJuCfpHNURUbyxRTaVLigo-Keyff60i_dSp9YCESQXTs98tzNQ@mail.gmail.com> (raw)
In-Reply-To: <20230804121416.533bb81336ded8f170da097e@linux-foundation.org>

On Fri, Aug 4, 2023 at 7:14 PM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> On Fri,  4 Aug 2023 08:27:19 -0700 Suren Baghdasaryan <surenb@google.com> wrote:
>
> > walk_page_range() and friends often operate under write-locked mmap_lock.
> > With introduction of vma locks, the vmas have to be locked as well
> > during such walks to prevent concurrent page faults in these areas.
> > Add an additional member to mm_walk_ops to indicate locking requirements
> > for the walk.
> >
> > ...
> >
> >  18 files changed, 100 insertions(+), 20 deletions(-)
> >
>
> That's a big patch for a -stable backport.
>
> Presumably the various -stable maintainers will be wondering why we're
> doing this.  But, as is so often the case, the changelog fails to
> describe any user-visible effects of the change.  Please send this info
> and I'll add it to the changelog.

The change ensures that page walks which prevent concurrent page
faults by write-locking mmap_lock, operate correctly after
introduction of per-vma locks. With per-vma locks page faults can be
handled under vma lock without taking mmap_lock at all, so write
locking mmap_lock would not stop them. The change ensures vmas are
properly locked during such walks. A sample issue this solves is
do_mbind() performing queue_pages_range() to queue pages for
migration. Without this change a concurrent page can be faulted into
the area and be left out of migration.

>
>


  reply	other threads:[~2023-08-04 19:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-04 15:27 [PATCH v4 0/6] make vma locking more obvious Suren Baghdasaryan
2023-08-04 15:27 ` [PATCH v4 1/6] mm: enable page walking API to lock vmas during the walk Suren Baghdasaryan
2023-08-04 19:14   ` Andrew Morton
2023-08-04 19:41     ` Suren Baghdasaryan [this message]
2023-08-04 15:27 ` [PATCH v4 2/6] mm: for !CONFIG_PER_VMA_LOCK equate write lock assertion for vma and mmap Suren Baghdasaryan
2023-08-04 15:27 ` [PATCH v4 3/6] mm: replace mmap with vma write lock assertions when operating on a vma Suren Baghdasaryan
2023-08-04 15:27 ` [PATCH v4 4/6] mm: lock vma explicitly before doing vm_flags_reset and vm_flags_reset_once Suren Baghdasaryan
2023-08-04 15:27 ` [PATCH v4 5/6] mm: always lock new vma before inserting into vma tree Suren Baghdasaryan
2023-08-14 14:54   ` Jann Horn
2023-08-14 19:15     ` Andrew Morton
2023-08-14 19:19       ` Liam R. Howlett
2023-08-14 20:02       ` Jann Horn
2023-08-14 20:06         ` Suren Baghdasaryan
2023-08-04 15:27 ` [PATCH v4 6/6] mm: move vma locking out of vma_prepare and dup_anon_vma Suren Baghdasaryan

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=CAJuCfpHNURUbyxRTaVLigo-Keyff60i_dSp9YCESQXTs98tzNQ@mail.gmail.com \
    --to=surenb@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=dave@stgolabs.net \
    --cc=david@redhat.com \
    --cc=hannes@cmpxchg.org \
    --cc=hughd@google.com \
    --cc=jannh@google.com \
    --cc=jglisse@google.com \
    --cc=kernel-team@android.com \
    --cc=ldufour@linux.ibm.com \
    --cc=liam.howlett@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=michel@lespinasse.org \
    --cc=peterx@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=torvalds@linuxfoundation.org \
    --cc=vbabka@suse.cz \
    --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