]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: add harddecommit GODEBUG flag
authorMichael Anthony Knyszek <mknyszek@google.com>
Mon, 18 Oct 2021 19:01:33 +0000 (19:01 +0000)
committerMichael Knyszek <mknyszek@google.com>
Fri, 5 Nov 2021 17:46:41 +0000 (17:46 +0000)
commitf063e0da28d441065d36f7d676f86d478f67db1f
treefe9b9eb65be12c6d21f37058edcd12050968782b
parent4f543b59c5618abccf0e78a17a2aeb173c085a91
runtime: add harddecommit GODEBUG flag

This change adds a new debug flag that makes the runtime map pages
PROT_NONE in sysUnused on Linux, in addition to the usual madvise calls.
This behavior mimics the behavior of decommit on Windows, and is helpful
in debugging the scavenger. sysUsed is also updated to re-map the pages
as PROT_READ|PROT_WRITE, mimicing Windows' explicit commit behavior.

Change-Id: Iaac5fcd0e6920bd1d0e753dd4e7f0c0b128fe842
Reviewed-on: https://go-review.googlesource.com/c/go/+/356612
Trust: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/runtime/extern.go
src/runtime/mem_linux.go
src/runtime/runtime1.go