[PATCH v6 1/6] hugepages: Move THP helpers to generic hugepages abstraction
Wilco Dijkstra
Wilco.Dijkstra@arm.com
Mon Mar 9 17:20:25 GMT 2026
Hi Rui,
> The helpers for determining the default transparent huge page size
> and THP mode are currently implemented in malloc-hugepages. However,
> these interfaces are not malloc-specific and are also needed by other
> subsystems (e.g. the dynamic loader for segment alignment).
>
> Introduce a new generic hugepages abstraction and move the THP mode
> detection, default THP page size probing, and hugepage configuration
> helpers there. The malloc code now calls into the generic helpers
> instead of duplicating the sysfs parsing.
>
> There is no functional change. This is a pure refactoring to make
> the THP detection reusable outside of malloc.
Looks good to me, thanks for cleaning this up!
Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
> * malloc/arena.c (__ptmalloc_init): Rename DEFAULT_THP_PAGESIZE to
(aside: GLIBC doesn't require changelog entries)
Cheers,
Wilco
More information about the Libc-alpha
mailing list