linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Zi Yan <ziy@nvidia.com>
To: Ryan Roberts <ryan.roberts@arm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	David Hildenbrand <david@kernel.org>,
	Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
	"Liam R. Howlett" <Liam.Howlett@oracle.com>,
	Vlastimil Babka <vbabka@suse.cz>, Mike Rapoport <rppt@kernel.org>,
	Suren Baghdasaryan <surenb@google.com>,
	Michal Hocko <mhocko@suse.com>,
	Brendan Jackman <jackmanb@google.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Uladzislau Rezki <urezki@gmail.com>,
	"Vishal Moola (Oracle)" <vishal.moola@gmail.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Kefeng Wang <wangkefeng.wang@huawei.com>
Subject: Re: [PATCH v1 0/2] Free contiguous order-0 pages efficiently
Date: Mon, 05 Jan 2026 11:36:20 -0500	[thread overview]
Message-ID: <D9734C47-0EDA-4154-8889-1B789B49322F@nvidia.com> (raw)
In-Reply-To: <20260105161741.3952456-1-ryan.roberts@arm.com>

On 5 Jan 2026, at 11:17, Ryan Roberts wrote:

> Hi All,
>
> A recent change to vmalloc caused some performance benchmark regressions (see
> [1]). I'm attempting to fix that (and at the same time signficantly improve
> beyond the baseline) by freeing a contiguous set of order-0 pages as a batch.
>
> At the same time I observed that free_contig_range() was essentially doing the
> same thing as vfree() so I've fixed it there too.
>
> I think I've convinced myself that free_pages_prepare() per order-0 page
> followed by a single free_frozen_page_commit() or free_one_page() for the high
> order block is safe/correct, but would be good if a page_alloc expert can
> confirm!
>
> Applies against today's mm-unstable (344d3580dacd). All mm selftests run and
> pass.

Kefeng has a series on using frozen pages for alloc_contig*() in mm-new
and touches free_contig_range() as well. You might want to rebase on top
of that.

I like your approach of freeing multiple order-0 pages as a batch, since
they are essentially a non-compound high order page. I also pointed out
a similar optimization when reviewing Kefeng’s patchset[1] (see my comment
on __free_contig_frozen_range()).

In terms of rebase, there should be minor for free_contig_range(). In addition,
maybe your free_prepared_contig_range() can replace __free_contig_frozen_range()
in Kefeng’s version to improve performance for both code paths.

I will take a look at the patches. Thanks.

[1] https://lore.kernel.org/linux-mm/D90F7769-F3A8-4234-A9CE-F97BC48CCACE@nvidia.com/

>
> Thanks,
> Ryan
>
> Ryan Roberts (2):
>   mm/page_alloc: Optimize free_contig_range()
>   vmalloc: Optimize vfree
>
>  include/linux/gfp.h |   1 +
>  mm/page_alloc.c     | 116 +++++++++++++++++++++++++++++++++++++++-----
>  mm/vmalloc.c        |  29 +++++++----
>  3 files changed, 125 insertions(+), 21 deletions(-)
>
> --
> 2.43.0


Best Regards,
Yan, Zi


  parent reply	other threads:[~2026-01-05 16:36 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-05 16:17 Ryan Roberts
2026-01-05 16:17 ` [PATCH v1 1/2] mm/page_alloc: Optimize free_contig_range() Ryan Roberts
2026-01-05 17:15   ` Zi Yan
2026-01-05 17:31     ` Ryan Roberts
2026-01-07  3:32       ` Zi Yan
2026-01-05 16:17 ` [PATCH v1 2/2] vmalloc: Optimize vfree Ryan Roberts
2026-01-06  4:36   ` Matthew Wilcox
2026-01-06  9:47     ` David Laight
2026-01-06 11:04     ` Ryan Roberts
2026-01-05 16:26 ` [PATCH v1 0/2] Free contiguous order-0 pages efficiently David Hildenbrand (Red Hat)
2026-01-05 16:36 ` Zi Yan [this message]
2026-01-05 16:41   ` Ryan Roberts
2026-01-06  4:38 ` Matthew Wilcox
2026-01-06 11:10   ` Ryan Roberts
2026-01-06 11:34   ` Uladzislau Rezki

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=D9734C47-0EDA-4154-8889-1B789B49322F@nvidia.com \
    --to=ziy@nvidia.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=jackmanb@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=mhocko@suse.com \
    --cc=rppt@kernel.org \
    --cc=ryan.roberts@arm.com \
    --cc=surenb@google.com \
    --cc=urezki@gmail.com \
    --cc=vbabka@suse.cz \
    --cc=vishal.moola@gmail.com \
    --cc=wangkefeng.wang@huawei.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