[PATCH] malloc: remember that thp_mode got probed

Wilco Dijkstra Wilco.Dijkstra@arm.com
Fri Feb 27 21:30:44 GMT 2026


Hi Aurelien,

> In the long term it would be nice to have a better interface with the
> kernel (but that can take time!), as parsing a file is less than ideal. 
> It means that seccomp filters [1] or apparmor profiles need to be update
> to allow access to that file in /sys.
>
> [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1128916

Yes, I discussed this with our kernel team and they seemed optimistic this
could be done by adding a THP bit to mmap. They also suggested to always
call madvise rather than checking /sys/kernel/mm since the syscall is fast and
harmless. I've posted a patch [2] for this which should make things work on all
containers again.

[2] https://sourceware.org/pipermail/libc-alpha/2026-February/175491.html

> Yes, I agree, the patch only fully fixes the repeated initialization,
> and only improves the situation with errno. OTOH it seems that
> identified issues are getting fixed (for instance dovecot got fixed
> upstream), so I am not sure what to do.

Yes it would be good to fix obvious issues. We could still save/restore errno
around malloc() as QoI similar to free().

Cheers,
Wilco


More information about the Libc-alpha mailing list