]> Cypherpunks repositories - gostls13.git/commit
runtime: add goschedIfBusy to bgsweep to prevent livelock after inlining
authorArsenySamoylov <samoylov.arseny@gmail.com>
Fri, 25 Apr 2025 11:28:52 +0000 (14:28 +0300)
committerGopher Robot <gobot@golang.org>
Mon, 12 May 2025 17:07:14 +0000 (10:07 -0700)
commite666f1dabf5174710919ab7cff3e8afefd9ac049
treed6f2cb12519457b3ce15b027c4eaec2c080830ae
parent343e486bfdbf9ca614d3e197afd79ad7ed5fef3e
runtime: add goschedIfBusy to bgsweep to prevent livelock after inlining

gcMarkTermination() ensures that all caches are flushed before continuing the GC cycle, thus preempting all goroutines.
However, inlining calls to lock() in bgsweep makes it non-preemptible for most of the time, leading to livelock.
This change adds explicit preemption to avoid this.

Fixes #73499.

Change-Id: I4abf0d658f3d7a03ad588469cd013a0639de0c8a
Reviewed-on: https://go-review.googlesource.com/c/go/+/668795
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/runtime/mgcsweep.go