From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Muchun Song <muchun.song@linux.dev>, Mike Rapoport <rppt@kernel.org>
Cc: 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 09:44:59 +0200 [thread overview]
Message-ID: <c4899f82-caa4-4692-bfdb-7ae4833f30cf@kernel.org> (raw)
In-Reply-To: <45BF3CAC-2E64-4CA7-A7B8-800FC90930D5@linux.dev>
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?
--
Cheers,
David
next prev parent reply other threads:[~2026-04-10 7:45 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) [this message]
2026-04-10 7:48 ` Muchun Song
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=c4899f82-caa4-4692-bfdb-7ae4833f30cf@kernel.org \
--to=david@kernel.org \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=mhocko@suse.com \
--cc=muchun.song@linux.dev \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.