[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aXqu-pe6kR4VDOnT@casper.infradead.org>
Date: Thu, 29 Jan 2026 00:51:06 +0000
From: Matthew Wilcox <willy@...radead.org>
To: Brian Geffon <bgeffon@...gle.com>
Cc: Justin Green <greenjustin@...omium.org>, akpm@...ux-foundation.org,
linux-mm@...ck.org, david@...nel.org, lorenzo.stoakes@...cle.com,
Liam.Howlett@...cle.com, vbabka@...e.cz, rppt@...nel.org,
surenb@...gle.com, mhocko@...e.com, linux-kernel@...r.kernel.org,
greenjustin@...gle.com, rientjes@...gle.com, arjunroy@...gle.com
Subject: Re: [PATCH] mm: Refactor vma_map_pages to use vm_insert_pages
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@...omium.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@...radead.org>
Powered by blists - more mailing lists