Re: Avoid reading /sys/kernel/mm/transparent_hugepage/?

Alexey Dobriyan
2026-04-10T08:35:32Z

On Fri, Apr 10, 2026 at 03:40:30PM +0800, H.J. Lu wrote:
> On Fri, Apr 10, 2026 at 3:28 PM Florian Weimer <fweimer@redhat.com> wrote:
> >
> > * H. J. Lu:
> >
> > > To enable THP segment load, ld.so opens and reads 2 files under
> > > /sys/kernel/mm/transparent_hugepage/. This requires mounting
> > > /sys and is expensive. Is it possible to put such info in vDSO?
> >
> > Alexey Dobriyan proposed adding AT_PAGE_SHIFT_LIST to the auxiliary
>
> Does it cover
>
> [hjl@gnu-tgl-3 linux]$ cat /sys/kernel/mm/transparent_hugepage/hpage_pmd_size
> 2097152
> [hjl@gnu-tgl-3 linux]$
>
> > vector a while back, but I don't know the status of that.

Status: nothing happened.

> How can we get
>
> [hjl@gnu-tgl-3 linux]$ cat /sys/kernel/mm/transparent_hugepage/enabled
> always [madvise] never
> [hjl@gnu-tgl-3 linux]$

This is not covered, see the link:
https://lore.kernel.org/lkml/ecb049aa-bcac-45c7-bbb1-4612d094935a@p183/

PAGE_SHIFT_MASK should be folded into system call probably.