mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: cancel mark and scavenge assists if the limiter is enabled
This change forces mark and scavenge assists to be cancelled early if the limiter is enabled. This avoids goroutines getting stuck in really long assists if the limiter happens to be disabled when they first come into the assist. This can get especially bad for mark assists, which, in dire situations, can end up "owing" the GC a really significant debt. For #52890. Change-Id: I4bfaa76b8de3e167d49d2ffd8bc2127b87ea566a Reviewed-on: https://go-review.googlesource.com/c/go/+/408816 Run-TryBot: Michael Knyszek <mknyszek@google.com> Reviewed-by: Michael Pratt <mpratt@google.com> Auto-Submit: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
parent
0f57c88bce
commit
1f0ef6bec7
4 changed files with 13 additions and 6 deletions
|
|
@ -811,7 +811,7 @@ func (p *PageAlloc) Bounds() (ChunkIdx, ChunkIdx) {
|
|||
func (p *PageAlloc) Scavenge(nbytes uintptr) (r uintptr) {
|
||||
pp := (*pageAlloc)(p)
|
||||
systemstack(func() {
|
||||
r = pp.scavenge(nbytes)
|
||||
r = pp.scavenge(nbytes, nil)
|
||||
})
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue