From: Matthew Wilcox <willy@infradead.org>
To: Brian Geffon <bgeffon@google.com>
Cc: Justin Green <greenjustin@chromium.org>,
akpm@linux-foundation.org, linux-mm@kvack.org, david@kernel.org,
lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com,
vbabka@suse.cz, rppt@kernel.org, surenb@google.com,
mhocko@suse.com, linux-kernel@vger.kernel.org,
greenjustin@google.com, rientjes@google.com, arjunroy@google.com
Subject: Re: [PATCH] mm: Refactor vma_map_pages to use vm_insert_pages
Date: Thu, 29 Jan 2026 00:51:06 +0000 [thread overview]
Message-ID: <aXqu-pe6kR4VDOnT@casper.infradead.org> (raw)
In-Reply-To: <CADyq12wpDTjHVGs7CTQ3SPNMO_ovmMk-rN7L4i_AGvdoLYQLnA@mail.gmail.com>
On Wed, Jan 28, 2026 at 05:59:12PM -0500, Brian Geffon wrote:
> On Wed, Jan 28, 2026 at 5:57 PM Justin Green <greenjustin@chromium.org> wrote:
> >
> > vma_map_pages currently calls vm_insert_page on each individual page in
> > the mapping, which creates significant overhead because we are
> > repeatedly spinlocking. Instead, we should batch insert pages using
> > vm_insert_pages, which amortizes the cost of the spinlock.
>
> This makes sense, I wonder why this wasn't done previously?
That's always a good question, because it might reveal why this patch is
a bad idea ...
However in this case, it simply seems to be an oversight.
__vm_map_pages() was introduced in May 2019 and then vm_insert_pages()
was added in April 2020.
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
next prev parent reply other threads:[~2026-01-29 0:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-28 22:56 Justin Green
2026-01-28 22:59 ` Brian Geffon
2026-01-29 0:51 ` Matthew Wilcox [this message]
2026-01-29 4:44 ` Arjun Roy
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=aXqu-pe6kR4VDOnT@casper.infradead.org \
--to=willy@infradead.org \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=arjunroy@google.com \
--cc=bgeffon@google.com \
--cc=david@kernel.org \
--cc=greenjustin@chromium.org \
--cc=greenjustin@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=mhocko@suse.com \
--cc=rientjes@google.com \
--cc=rppt@kernel.org \
--cc=surenb@google.com \
--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