You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, Go's hugepage-related policies do not play well together and have bit-rotted. The result is that the memory regions the Go runtime chooses to mark as MADV_NOHUGEPAGE and MADV_HUGEPAGE are somewhat haphazard, resulting in memory overuse for small heaps. The memory overuse is upwards of 40% memory overhead in some cases. Turning off huge pages entirely fixes the problem, but leaves CPU performance on the table. This policy also means large heaps might have dense sections that are erroneously mapped as MADV_NOHUGEPAGE, costing up to 1% throughput.
The goal of this work is to eliminate this overhead for small heaps while improving huge page utilization for large heaps.
TL;DR: Determine which parts of the heap should be backed by huge pages based on near-future density of page allocator chunks. This density heuristic is then also used to delay the background scavenger: only chunks that have been sparse for at least one GC cycle are eligible for scavenging. The scavenger also breaks up hugepages.
Activity
mknyszek commentedon May 3, 2023
Landed in https://go.dev/cl/436395.
[-]runtime: hugepage-aware heap[/-][+]runtime: improve heap hugepage utilization[/+]gopherbot commentedon May 3, 2023
Change https://go.dev/cl/492018 mentions this issue:
design/59960-heap-hugepage-util.md: add designdesign/59960-heap-hugepage-util.md: add design
gopherbot commentedon Oct 2, 2023
Change https://go.dev/cl/531816 mentions this issue:
runtime: don't eagerly collapse hugepagesgopherbot commentedon Oct 2, 2023
Change https://go.dev/cl/532117 mentions this issue:
runtime: delete hugepage tracking dead coderuntime: don't eagerly collapse hugepages
runtime: delete hugepage tracking dead code
gopherbot commentedon Oct 2, 2023
Change https://go.dev/cl/532255 mentions this issue:
[release-branch.go1.21] runtime: don't eagerly collapse hugepages[release-branch.go1.21] runtime: don't eagerly collapse hugepages