Re: [PATCH 2.43] malloc: Show hugetlb tunable default in --list-tunables
Wilco Dijkstra <[email protected]>
| Newsgroups | gmane.comp.lib.glibc.alpha |
|---|---|
| Message-ID | <PAWPR08MB89820058F36BECA00161F35A83DB2@PAWPR08MB8982.eurprd08.prod.outlook.com> |
Hi Alexander,
The backport looks fine - I can do the commit if you don't have write access.
However I disagree with this part:
> ... but commit 2e8a940df14e
> ("malloc: Avoid accessing /sys/kernel/mm files") has broken the tunable
> again (glibc.malloc.hugetlb didn't affect mp_.thp_pagesize any longer).
Only setting mp_.thp_pagesize without madvise calls does not result in increased
memory usage - it basically does the same as top_pad: it rounds up allocations
to reduce the number of mmap/sbrk system calls. You need to access each page
to get actual memory allocated to it.
In the future we'll use MADV_DONTNEED and MADV_FREE more to release memory.
This will likely cause confusion since the pages may not immediately be released by
the kernel. And similar to above case, the mmap remains valid (and accessing the
freed pages will allocate a new page).
So if you count the total mmap space rather than actual pages in use then memory
use will appear much larger than it actually is.
Cheers,
Wilco