From: Kefeng Wang <wangkefeng.wang@huawei.com>
To: David Hildenbrand <david@redhat.com>,
<20250910133958.301467-1-wangkefeng.wang@huawei.com>,
Andrew Morton <akpm@linux-foundation.org>,
Oscar Salvador <osalvador@suse.de>,
Muchun Song <muchun.song@linux.dev>, Zi Yan <ziy@nvidia.com>,
Matthew Wilcox <willy@infradead.org>
Cc: <sidhartha.kumar@oracle.com>, <jane.chu@oracle.com>,
Vlastimil Babka <vbabka@suse.cz>,
Brendan Jackman <jackmanb@google.com>,
Johannes Weiner <hannes@cmpxchg.org>, <linux-mm@kvack.org>
Subject: Re: [PATCH 4/4] mm: hugetlb: allocate frozen pages in alloc_gigantic_folio()
Date: Thu, 11 Sep 2025 17:11:29 +0800 [thread overview]
Message-ID: <8508e8fb-77cc-43a7-8460-456f68a552ba@huawei.com> (raw)
In-Reply-To: <90e926c9-40cb-4791-8360-e3d145fe3503@redhat.com>
On 2025/9/11 16:25, David Hildenbrand wrote:
> On 11.09.25 08:56, Kefeng Wang wrote:
>> The alloc_gigantic_folio() allocates a folio by alloc_contig_range()
>> with refcount increated and then freeze it, convert to allocate a frozen
>> folio directly to remove the atomic operation about folio refcount, also
>> saving atomic operation during __update_and_free_hugetlb_folio too.
>>
>> Rename some functions to make them more self-explanatory,
>>
>> folio_alloc_gigantic -> folio_alloc_frozen_gigantic
>> cma_{alloc,free}_folio -> cma_{alloc,free}_frozen_folio
>> hugetlb_cma_{alloc,free}_folio -> hugetlb_cma_{alloc,free}
>> _frozen_folio
>
> Can we just get rid of folio_alloc_frozen_gigantic?
>
OK, we could kill it.
> Further, can we just get rid of cma_{alloc,free}_frozen_folio() as well
> and just let hugetlb use alloc_contig_range_frozen() etc?
HugeTLB can allocate folio by alloc_contig_frozen_pages() directly, but
it could allocate from hugetlb_cma, cma_alloc_folio() need change some
cma metadata, so we need to keep it.
>
> Long term alloc_contig_range() should just return frozen pages.
>
Yes, Matthew mention this too, this is the reason for the new version.
Thanks
next prev parent reply other threads:[~2025-09-11 9:11 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-11 6:56 [PATCH 0/4] mm: hugetlb: allocate frozen gigantic folio Kefeng Wang
2025-09-11 6:56 ` [PATCH 1/4] mm: debug_vm_pgtable: add debug_vm_pgtable_free_huge_page() Kefeng Wang
2025-09-12 6:58 ` Kefeng Wang
2025-09-11 6:56 ` [PATCH 2/4] mm: page_alloc: add alloc_contig_{range_frozen,frozen_pages}() Kefeng Wang
2025-09-11 6:56 ` [PATCH 3/4] mm: cma: add __cma_release() Kefeng Wang
2025-09-11 6:56 ` [PATCH 4/4] mm: hugetlb: allocate frozen pages in alloc_gigantic_folio() Kefeng Wang
2025-09-11 8:25 ` David Hildenbrand
2025-09-11 9:11 ` Kefeng Wang [this message]
2025-09-11 18:56 ` David Hildenbrand
2025-09-12 6:57 ` Kefeng Wang
2025-09-12 7:18 ` David Hildenbrand
2025-09-12 7:23 ` David Hildenbrand
2025-09-12 9:12 ` Kefeng Wang
2025-09-12 18:07 ` David Hildenbrand
2025-09-13 4:13 ` Kefeng Wang
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=8508e8fb-77cc-43a7-8460-456f68a552ba@huawei.com \
--to=wangkefeng.wang@huawei.com \
--cc=20250910133958.301467-1-wangkefeng.wang@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=hannes@cmpxchg.org \
--cc=jackmanb@google.com \
--cc=jane.chu@oracle.com \
--cc=linux-mm@kvack.org \
--cc=muchun.song@linux.dev \
--cc=osalvador@suse.de \
--cc=sidhartha.kumar@oracle.com \
--cc=vbabka@suse.cz \
--cc=willy@infradead.org \
--cc=ziy@nvidia.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