Re: [PATCH v2 1/2] mm/hugetlb: create hstate_is_gigantic_no_runtime helper

From: SeongJae Park
Date: Thu Oct 09 2025 - 15:24:41 EST


On Thu, 9 Oct 2025 12:11:49 -0700 SeongJae Park <sj@xxxxxxxxxx> wrote:

> Hi Usama,
>
> On Thu, 9 Oct 2025 18:24:30 +0100 Usama Arif <usamaarif642@xxxxxxxxx> wrote:
>
> > This is a common condition used to skip operations that cannot
> > be performed on gigantic pages when runtime support is disabled.
> > This helper is introduced as the condition will exist even more
> > when allowing "overcommit" of gigantic hugepages.
> > No functional change intended with this patch.
[...]
> It seems the new helper could be used for three more cases.
>
> On mm-new:
>
> $ git grep gigantic_page_runtime_supported mm/hugetlb.c
> mm/hugetlb.c: if (hstate_is_gigantic(h) && !gigantic_page_runtime_supported())
> mm/hugetlb.c: if (hstate_is_gigantic(h) && !gigantic_page_runtime_supported())
> mm/hugetlb.c: if (hstate_is_gigantic(h) && !gigantic_page_runtime_supported())
> mm/hugetlb.c: if (hstate_is_gigantic(h) && !gigantic_page_runtime_supported())
> mm/hugetlb.c: if (hstate_is_gigantic(h) && !gigantic_page_runtime_supported())
> mm/hugetlb.c: if (hstate_is_gigantic(h) && !gigantic_page_runtime_supported())
> mm/hugetlb.c: if (hstate_is_gigantic(h) && !gigantic_page_runtime_supported())
> mm/hugetlb.c: if (write && hstate_is_gigantic(h) && !gigantic_page_runtime_supported())
>
> After applying this patch on top of mm-new:
>
> $ git grep gigantic_page_runtime_supported mm/hugetlb.c
> mm/hugetlb.c: return hstate_is_gigantic(h) && !gigantic_page_runtime_supported();
> mm/hugetlb.c: if (hstate_is_gigantic(h) && !gigantic_page_runtime_supported())
> mm/hugetlb.c: if (hstate_is_gigantic(h) && !gigantic_page_runtime_supported())
> mm/hugetlb.c: if (write && hstate_is_gigantic(h) && !gigantic_page_runtime_supported())
>
> I'm curious if you are planning to do the conversion later, or there is a
> reason why this patch is keeping those as is but I'm missing.

Ah, seems like that's because the v1 [1] of this series is already merged into
mm-new.

Please ignore the above question unless I'm wrong.

[1] https://patch.msgid.link/20251009172433.4158118-1-usamaarif642@xxxxxxxxx


Thanks,
SJ

[...]