]> Cypherpunks repositories - gostls13.git/commit
runtime: add option to scavenge with lock held throughout
authorMichael Anthony Knyszek <mknyszek@google.com>
Thu, 12 Sep 2019 18:24:56 +0000 (18:24 +0000)
committerMichael Knyszek <mknyszek@google.com>
Thu, 7 Nov 2019 19:14:47 +0000 (19:14 +0000)
commite5ce13c178cc0be72ca220b4c3f0c95f570c19ab
treeb2c5f7c0307de829d86996d5c04b55cdea24e307
parente1ddf0507c6d6dcbe1a2ebe54b8728498edf0995
runtime: add option to scavenge with lock held throughout

This change adds a "locked" parameter to scavenge() and scavengeone()
which allows these methods to be run with the heap lock acquired, and
synchronously with respect to others which acquire the heap lock.

This mode is necessary for both heap-growth scavenging (multiple
asynchronous scavengers here could be problematic) and
debug.FreeOSMemory.

Updates #35112.

Change-Id: I24eea8e40f971760999c980981893676b4c9b666
Reviewed-on: https://go-review.googlesource.com/c/go/+/195699
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
src/runtime/export_test.go
src/runtime/mgcscavenge.go
src/runtime/mgcscavenge_test.go