]> Cypherpunks repositories - gostls13.git/commit
runtime: cancel mark and scavenge assists if the limiter is enabled
authorMichael Anthony Knyszek <mknyszek@google.com>
Wed, 25 May 2022 22:51:21 +0000 (22:51 +0000)
committerGopher Robot <gobot@golang.org>
Fri, 27 May 2022 17:30:15 +0000 (17:30 +0000)
commit1f0ef6bec73e972d15e1c44307558a8263f81ea4
tree30a0d091a9c7c0272368fe060c973c69b6ff9935
parent0f57c88bce9899a91686646a1e9cd7aae55911ef
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>
src/runtime/export_test.go
src/runtime/mgcmark.go
src/runtime/mgcscavenge.go
src/runtime/mheap.go