public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Muchun Song <muchun.song@linux.dev>
To: "David Hildenbrand (Arm)" <david@kernel.org>
Cc: Mike Rapoport <rppt@kernel.org>,
	Muchun Song <songmuchun@bytedance.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	yinghai@kernel.org, Lorenzo Stoakes <ljs@kernel.org>,
	"Liam R. Howlett" <Liam.Howlett@oracle.com>,
	Vlastimil Babka <vbabka@kernel.org>,
	Suren Baghdasaryan <surenb@google.com>,
	Michal Hocko <mhocko@suse.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] mm/sparse: remove sparse_buffer
Date: Fri, 10 Apr 2026 15:48:41 +0800	[thread overview]
Message-ID: <242A2DF3-93E3-4D31-926A-03459AD3095E@linux.dev> (raw)
In-Reply-To: <c4899f82-caa4-4692-bfdb-7ae4833f30cf@kernel.org>



> On Apr 10, 2026, at 15:44, David Hildenbrand (Arm) <david@kernel.org> wrote:
> 
> On 4/10/26 08:05, Muchun Song wrote:
>> 
>> 
>>> On Apr 10, 2026, at 11:07, Muchun Song <muchun.song@linux.dev> wrote:
>>> 
>>> 
>>> 
>>>> 
>>>> Hi,
>>>> 
>>>> 
>>>> memblock always allocates in order, so if there are no other memblock
>>>> allocations between the calls to memmap_alloc(), all these allocations will
>>>> be together and they all will be coalesced to a single region in
>>>> memblock.reserved.
>>>> 
>>>> 
>>>> ...
>>>> 
>>>> 
>>>> memmap_alloc() will be slower than sparse_buffer_alloc(), allocating from
>>>> memblock is more involved that sparse_buffer_alloc(), but without
>>>> measurements it's hard to tell how much it'll affect overall sparse_init().
>>> 
>>> I ran a test on a 256GB VM, and the results are as follows:
>>> 
>>> With patch:    741,292 ns
>>> Without patch: 199,555 ns
>>> 
>>> The performance is approximately 3.7x slower with the patch applied.
>> 
>> I also tested 512GB of data, and the results were roughly twice that
>> of 256GB, so for a 1TB machine, the memory allocation time is only a
>> few milliseconds. It seems we don’t need to worry about the 3.7x
>> performance drop.
> 
> Good. Can you incorporate all that into the patch description?
> 

Yes. No problem.

> -- 
> Cheers,
> 
> David


      reply	other threads:[~2026-04-10  7:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-07  8:39 [RFC PATCH] mm/sparse: remove sparse_buffer Muchun Song
2026-04-08 13:40 ` David Hildenbrand (Arm)
2026-04-09 11:40   ` Muchun Song
2026-04-09 12:29     ` David Hildenbrand (Arm)
2026-04-09 15:10       ` Mike Rapoport
2026-04-10  3:07         ` Muchun Song
2026-04-10  6:05           ` Muchun Song
2026-04-10  7:44             ` David Hildenbrand (Arm)
2026-04-10  7:48               ` Muchun Song [this message]

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=242A2DF3-93E3-4D31-926A-03459AD3095E@linux.dev \
    --to=muchun.song@linux.dev \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=mhocko@suse.com \
    --cc=rppt@kernel.org \
    --cc=songmuchun@bytedance.com \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.org \
    --cc=yinghai@kernel.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