Thread (6 messages) 6 messages, 4 authors, 2025-08-29

Re: [PATCH v1 08/36] mm/hugetlb: check for unreasonable folio sizes when registering hstate

From: Zi Yan <ziy@nvidia.com>
Date: 2025-08-28 01:04:39
Also in: dri-devel, intel-gfx, io-uring, kvm, linux-crypto, linux-ide, linux-iommu, linux-kselftest, linux-mips, linux-mm, linux-mmc, linux-riscv, linux-s390, linux-scsi, lkml, netdev, virtualization

On 27 Aug 2025, at 18:01, David Hildenbrand wrote:
Let's check that no hstate that corresponds to an unreasonable folio size
is registered by an architecture. If we were to succeed registering, we
could later try allocating an unsupported gigantic folio size.

Further, let's add a BUILD_BUG_ON() for checking that HUGETLB_PAGE_ORDER
is sane at build time. As HUGETLB_PAGE_ORDER is dynamic on powerpc, we have
to use a BUILD_BUG_ON_INVALID() to make it compile.

No existing kernel configuration should be able to trigger this check:
either SPARSEMEM without SPARSEMEM_VMEMMAP cannot be configured or
gigantic folios will not exceed a memory section (the case on sparse).

Signed-off-by: David Hildenbrand <redacted>
---
 mm/hugetlb.c | 2 ++
 1 file changed, 2 insertions(+)
LGTM. Reviewed-by: Zi Yan [off-list ref]

--
Best Regards,
Yan, Zi
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help