From: Suren Baghdasaryan <surenb@google.com>
To: Lokesh Gidra <lokeshgidra@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>, Peter Xu <peterx@redhat.com>,
David Hildenbrand <david@redhat.com>,
Axel Rasmussen <axelrasmussen@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
"open list:MEMORY MANAGEMENT" <linux-mm@kvack.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Andrea Arcangeli <aarcange@redhat.com>,
"Kirill A . Shutemov" <kirill@shutemov.name>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
Brian Geffon <bgeffon@google.com>,
Kalesh Singh <kaleshsingh@google.com>,
Nicolas Geoffray <ngeoffray@google.com>,
Jared Duke <jdduke@google.com>,
android-mm <android-mm@google.com>,
Blake Caldwell <blake.caldwell@colorado.edu>,
Mike Rapoport <rppt@kernel.org>
Subject: Re: RFC for new feature to move pages from one vma to another without split
Date: Thu, 14 Sep 2023 08:30:59 -0700 [thread overview]
Message-ID: <CAJuCfpHEXDiUBGZ1RCiHRyewTQ_6NNG3+PvLQuhn99eCmPbgTA@mail.gmail.com> (raw)
In-Reply-To: <CA+EESO6NkpugZa7zh=mj+A0BEqMuS4TKL0cpTm4EWeHgUUVksg@mail.gmail.com>
On Thu, Jun 8, 2023 at 3:05 AM Lokesh Gidra <lokeshgidra@google.com> wrote:
>
> On Tue, Jun 6, 2023 at 4:18 PM Suren Baghdasaryan <surenb@google.com> wrote:
> >
> > On Tue, Jun 6, 2023 at 1:15 PM Vlastimil Babka <vbabka@suse.cz> wrote:
> > >
> > > On 4/13/23 17:36, Peter Xu wrote:
> > > > On Thu, Apr 13, 2023 at 10:10:44AM +0200, David Hildenbrand wrote:
> > > >> So instead, we consider the whole address space as a virtual, anon file,
> > > >> starting at offset 0. The pgoff of a VMA is then simply the offset in that
> > > >> virtual file (easily computed from the start of the VMA), and VMA merging is
> > > >> just the same as for an ordinary file.
> > > >
> > > > Interesting point, thanks!
> > >
> > > FYI, I've advised a master thesis exploring how to update page->index during
> > > mremap() to keep things mergeable:
> > >
> > > https://dspace.cuni.cz/bitstream/handle/20.500.11956/176288/120426800.pdf
> > >
> > > I think the last RFC posting was:
> > > https://lore.kernel.org/all/20220516125405.1675-1-matenajakub@gmail.com/
> > >
> > > It was really tricky for the general case. Maybe it would be more feasible
> > > for the limited case Lokesh describes, if we could be sure the pages that
> > > are moved aren't mapped anywhere else.
>
> It's great that mremap is being improved for mereabilitly. However,
> IIUC, it would still cause unnecessary splits and merges in the
> private anonymous case. Also, mremap works with mmap_sem exclusively
> held, thereby impacting scalability of concurrent mremap calls.
>
> IMHO, Andrea's userfaultfd REMAP patch is a better alternative as it
> doesn't have these downsides.
>
> >
> > Lokesh asked me to pick up this work and prepare patches for
> > upstreaming. I'll start working on them after I finish with per-vma
> > lock support for swap and userfaultd (targeting later this week).
> > Thanks for all the input folks!
>
> Thanks so much, Suren!
I just posted the patchset at
https://lore.kernel.org/all/20230914152620.2743033-1-surenb@google.com/.
I tried to keep it as true to Andrea's original as possible but still
had to make some sizable changes, which I described in the cover
letter. Feedback would be much appreciated!
next prev parent reply other threads:[~2023-09-14 15:31 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-16 22:27 RFC for new feature to move pages from one vma to another without split Lokesh Gidra
2023-04-06 17:29 ` Peter Xu
2023-04-10 7:41 ` Lokesh Gidra
2023-04-11 15:14 ` Peter Xu
2023-05-08 22:56 ` Lokesh Gidra
2023-05-16 16:43 ` Peter Xu
2023-04-12 8:47 ` David Hildenbrand
2023-04-12 15:58 ` Peter Xu
2023-04-13 8:10 ` David Hildenbrand
2023-04-13 15:36 ` Peter Xu
2023-06-06 20:15 ` Vlastimil Babka
2023-06-06 23:18 ` Suren Baghdasaryan
2023-06-08 10:05 ` Lokesh Gidra
2023-09-14 15:30 ` Suren Baghdasaryan [this message]
2023-06-07 20:17 ` Lorenzo Stoakes
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=CAJuCfpHEXDiUBGZ1RCiHRyewTQ_6NNG3+PvLQuhn99eCmPbgTA@mail.gmail.com \
--to=surenb@google.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=android-mm@google.com \
--cc=axelrasmussen@google.com \
--cc=bgeffon@google.com \
--cc=blake.caldwell@colorado.edu \
--cc=david@redhat.com \
--cc=jdduke@google.com \
--cc=kaleshsingh@google.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=kirill@shutemov.name \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lokeshgidra@google.com \
--cc=ngeoffray@google.com \
--cc=peterx@redhat.com \
--cc=rppt@kernel.org \
--cc=vbabka@suse.cz \
/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).