[PATCH] malloc: Avoid accessing /sys/kernel/mm files
Aurelien Jarno
aurelien@aurel32.net
Mon Mar 2 19:58:52 GMT 2026
Hi,
On 2026-03-01 22:37, Aurelien Jarno wrote:
> Hi Wilco,
>
> On 2026-02-27 21:03, Wilco Dijkstra wrote:
> >
> > On AArch64 malloc always checks /sys/kernel/mm/transparent_hugepage/enabled to set
> > the THP mode. However this check is quite expensive and the file may not be accessible
> > in containers. If DEFAULT_THP_PAGESIZE is non-zero, use malloc_thp_mode_madvise so that
> > we take advantage of THP in all cases. Since madvise is a fast systemcall, it adds only
> > a small overhead compared to the cost of mmap and populating the pages.
> >
> > Passes regress, OK for commit?
>
> The strategy sounds good if you confirm it does not have performance
> impact. Not having to probe a file in /sys is definitely way better.
>
> I have tested this patch. The apparmor warnings are gone. And among all
> the issues I have found with 2MB THP, it seems that only rumur is still
> failing in its testsuite, but in a different way than before. I'll try
> to debug and report back.
I have been able to debug that, and it happens that the issue is again
the seccomp filter. This time madvise has to be allowed instead of
openat. I have sent a patch to the debian bug report.
Regards
Aurelien
--
Aurelien Jarno GPG: 4096R/1DDD8C9B
aurelien@aurel32.net http://aurel32.net
More information about the Libc-alpha
mailing list