[PATCH] thp: Disable THP if THP isn't supported by kernel

Wilco Dijkstra <[email protected]>
Newsgroups gmane.comp.lib.glibc.alpha
Message-ID <PAWPR08MB898277507D8D0BA47EC198AF83C12@PAWPR08MB8982.eurprd08.prod.outlook.com>
Hi HJ,

> Since DL_MAP_DEFAULT_THP_PAGESIZE is defined for x86-64, THP control
> is to set to madvise by default.  If THP is disabled in x86-64 kernel,
> madvise (..., MADV_HUGEPAGE) returns -EINVAL to indicate that THP isn't
> supported.  Add _dl_thp_madvise to disable THP in this case.  This
> fixes BZ #34348.

Are there enough calls in the loader that this is worthwhile?

More importantly, does this actually work? I always get 0 result from madvise
calls irrespectively of the madvise settings... Does it need a new kernel or is
this target specific?

If we can get it to work, it could be useful in madvise_thp() since there are
potentially millions madvise calls.

Cheers,
Wilco
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.