From: "Qi Zheng" <zhengqi.arch@bytedance.com>
To: "David Hildenbrand (Arm)" <david@kernel.org>,
"Jose A. Perez de Azpillaga" <azpijr@gmail.com>,
"Muchun Song" <muchun.song@linux.dev>
Cc: "Qi Zheng" <qi.zheng@linux.dev>, <osalvador@suse.de>,
<akpm@linux-foundation.org>, <linux-mm@kvack.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 0/5] mm: hugetlb: add CMA support for PMD-sized page
Date: Tue, 20 Oct 2026 15:46:49 +0800 [thread overview]
Message-ID: <76a568ec-a23f-4a8b-ba14-e5a40083e1e4@bytedance.com> (raw)
In-Reply-To: <1eff2f1a-b7bc-4541-82f0-9836d0a5db5c@kernel.org>
On 10/19/26 8:18 PM, David Hildenbrand (Arm) wrote:
> On 10/19/26 11:17, Jose A. Perez de Azpillaga wrote:
>> On 10/19/26 10:43 AM, Muchun Song wrote:
>>>
>>>
>>>>
>>>>
>>>> wouldn't a shared pool still be sized and aligned for 1G? then the 2M
>>>> headroom stays a multiple of 1G and the 1G-aligned reservation can still
>>>> fail, which is what the series is trying to avoid.
>>>
>>> If we decide to use a shared pool, I think the current alignment strategy
>>> should be adapted as well, it should be changed to align with the minimal
>>> acquirement, like 2M.
>>>
>>> For example, if a user reserves 1G+2M through hugetlb_cma, then the memory
>>> reserved by the pool is also 1G+2M, except that the starting address needs
>>> to be aligned to the largest gigantic page (1G). Therefore, this pool is
>>> suitable for both 1GB and 2MB allocation. The only problem I see with a
>>> shared pool is that it may not support mixed-use scenarios very well.
>>>
>>> What do you think?
>>
>> makes sense to me. existing hugetlb_cma= users with WM pages would get
>> mixed use without asking for it though.
>
> Yeah, my intuition tells me that having 1 allocation size per CMA area might be
> cleaner.
Agree.
>
> Assume you allocate 512 2 MiB hugetlb folios. You'd think that you would then be
> able to allocate 1 GiB hugetlb folio less. But that's not guaranteed, as CMA
> might just fallback to other areas fairly easily.
>
> If someone wants to convert from 1 GiB to 512 x 2MiB, I think the demotion
> interface allows for that.
For this series, I'd like to use a separate CMA pool for the newly
supported PMD-sized pages, while keeping the existing sharing among
gigantic sizes unchanged.
If there are no objections, I'll update v2.
Thanks,
Qi
prev parent reply other threads:[~2026-10-20 7:47 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 10:07 Qi Zheng
2026-10-16 10:07 ` [PATCH 1/5] mm: hugetlb: add explicit page size to hugetlb_cma Qi Zheng
2026-10-17 17:31 ` Jose A. Perez de Azpillaga
2026-10-16 10:07 ` [PATCH 2/5] mm: hugetlb: group CMA pool and reservation state Qi Zheng
2026-10-17 17:53 ` Jose A. Perez de Azpillaga
2026-10-16 10:07 ` [PATCH 3/5] mm: hugetlb: track CMA reservations by page order Qi Zheng
2026-10-17 18:41 ` Jose A. Perez de Azpillaga
2026-10-19 7:10 ` Qi Zheng
2026-10-16 10:07 ` [PATCH 4/5] mm: hugetlb: avoid recursive CMA allocation during migration Qi Zheng
2026-10-17 18:54 ` Jose A. Perez de Azpillaga
2026-10-19 7:17 ` Qi Zheng
2026-10-16 10:07 ` [PATCH 5/5] mm: hugetlb: enable CMA allocation for PMD-sized pages Qi Zheng
2026-10-17 19:07 ` Jose A. Perez de Azpillaga
2026-10-19 7:32 ` Qi Zheng
2026-10-19 6:50 ` [PATCH 0/5] mm: hugetlb: add CMA support for PMD-sized page Muchun Song
2026-10-19 7:37 ` Qi Zheng
2026-10-19 7:50 ` Muchun Song
2026-10-19 8:20 ` Jose A. Perez de Azpillaga
2026-10-19 8:43 ` Muchun Song
2026-10-19 9:17 ` Jose A. Perez de Azpillaga
2026-10-19 12:18 ` David Hildenbrand (Arm)
2026-10-20 7:46 ` Qi Zheng [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=76a568ec-a23f-4a8b-ba14-e5a40083e1e4@bytedance.com \
--to=zhengqi.arch@bytedance.com \
--cc=akpm@linux-foundation.org \
--cc=azpijr@gmail.com \
--cc=david@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=muchun.song@linux.dev \
--cc=osalvador@suse.de \
--cc=qi.zheng@linux.dev \
/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
all inboxes | Powered by JetHome®