diff options
author | Michael Anthony Knyszek <mknyszek@google.com> | 2019-04-18 15:42:58 +0000 |
---|---|---|
committer | Michael Knyszek <mknyszek@google.com> | 2019-05-06 21:15:01 +0000 |
commit | 31c4e099158b0e4999c05ee4daf08531f6640ad4 (patch) | |
tree | 1b7653c83e615dd9bfccd812e970a67bad7c2a5e /src/runtime/mem_windows.go | |
parent | 5c15ed64deaf71dd3b84470f3de8aae0b667d6ef (diff) | |
download | go-31c4e099158b0e4999c05ee4daf08531f6640ad4.tar.gz go-31c4e099158b0e4999c05ee4daf08531f6640ad4.zip |
runtime: ensure free and unscavenged spans may be backed by huge pages
This change adds a new sysHugePage function to provide the equivalent of
Linux's madvise(MADV_HUGEPAGE) support to the runtime. It then uses
sysHugePage to mark a newly-coalesced free span as backable by huge
pages to make the freeHugePages approximation a bit more accurate.
The problem being solved here is that if a large free span is composed
of many small spans which were coalesced together, then there's a chance
that they have had madvise(MADV_NOHUGEPAGE) called on them at some point,
which makes freeHugePages less accurate.
For #30333.
Change-Id: Idd4b02567619fc8d45647d9abd18da42f96f0522
Reviewed-on: https://go-review.googlesource.com/c/go/+/173338
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/runtime/mem_windows.go')
-rw-r--r-- | src/runtime/mem_windows.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/runtime/mem_windows.go b/src/runtime/mem_windows.go index fc52ec59a0..f752136706 100644 --- a/src/runtime/mem_windows.go +++ b/src/runtime/mem_windows.go @@ -81,6 +81,9 @@ func sysUsed(v unsafe.Pointer, n uintptr) { } } +func sysHugePage(v unsafe.Pointer, n uintptr) { +} + // Don't split the stack as this function may be invoked without a valid G, // which prevents us from allocating more stack. //go:nosplit |