]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: yield in goschedIfBusy if gp.preempt
authorMichael Pratt <mpratt@google.com>
Tue, 1 Nov 2022 21:27:41 +0000 (17:27 -0400)
committerMichael Pratt <mpratt@google.com>
Mon, 7 Nov 2022 17:19:18 +0000 (17:19 +0000)
commit50664c236f9ab38cd57e0a36cf29527d4c513010
treef962507668aa4743e56cec95ff00464bfc4e621b
parent82c6967adad6319ac08fca4f3e84066a43083963
runtime: yield in goschedIfBusy if gp.preempt

runtime.bgsweep contains an infinite loop. With aggressive enough
inlining, it may not perform any CALLs on a typical iteration. If
the runtime trying to preempt this goroutine, the lack of CALLs may
prevent preemption for ever occurring.

bgsweep does happen to call goschedIfBusy. Add a preempt check there to
make sure we yield eventually.

For #55022.

Change-Id: If22eb86fd6a626094b3c56dc745c8e4243b0fb40
Reviewed-on: https://go-review.googlesource.com/c/go/+/447135
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/runtime/proc.go