]> Cypherpunks repositories - gostls13.git/commit
runtime: explicitly exclude a potential deadlock in the scheduler
authorDmitrii Martynov <fkr011288@gmail.com>
Wed, 2 Apr 2025 10:58:18 +0000 (13:58 +0300)
committerKeith Randall <khr@golang.org>
Wed, 9 Apr 2025 23:12:45 +0000 (16:12 -0700)
commita42e337edee375a91f304bb890e7ec24594058b9
tree626456618d58c6317c76c61a32af763f619569cd
parent8898450841e2febb86028389e358d9d906fddbfb
runtime: explicitly exclude a potential deadlock in the scheduler

The following sequence in the scheduler may potentially lead to
deadlock:
- globrunqget() -> runqput() -> runqputslow() -> globrunqputbatch()
However, according to the current logic of the scheduler it is not
possible to face the deadlock.

The patch explicitly excludes the deadlock, even though it is impossible
situation at the moment.

Additionally, the "runq" and "globrunq" APIs were partially refactored,
which allowed to minimize the usage of these APIs by each other.
This will prevent situations described in the CL.

Change-Id: I7318f935d285b95522998e0903eaa6193af2ba48
Reviewed-on: https://go-review.googlesource.com/c/go/+/662216
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
src/runtime/proc.go