Re: [PATCH] mm/hugetlb: Make __NR_USED_SUBPAGE check conditional

From: Oscar Salvador
Date: Mon Dec 02 2024 - 05:37:44 EST


On Mon, Dec 02, 2024 at 02:37:28PM +0530, Anshuman Khandual wrote:
> The HugeTLB order check against __NR_USED_SUBPAGE is required only when
> HUGETLB_PAGE_OPTIMIZE_VMEMMAP is enabled. Hence BUG_ON() trigger should
> happen only when applicable.
>
> Cc: Muchun Song <muchun.song@xxxxxxxxx>
> Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Cc: linux-mm@xxxxxxxxx
> Cc: linux-kernel@xxxxxxxxxxxxxxx
> Signed-off-by: Anshuman Khandual <anshuman.khandual@xxxxxxx>
> ---
...
> +
> BUG_ON(hugetlb_max_hstate >= HUGE_MAX_HSTATE);
> +#ifdef HUGETLB_PAGE_OPTIMIZE_VMEMMAP

#ifdef CONFIG_HUGETLB_PAGE_OPTIMIZE_VMEMMAP ?


--
Oscar Salvador
SUSE Labs