aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/testdata/script
diff options
context:
space:
mode:
authorMichael Anthony Knyszek <mknyszek@google.com>2025-09-05 17:39:09 +0000
committerGopher Robot <gobot@golang.org>2025-09-23 09:18:03 -0700
commitfde10c4ce7f3b32acd886992450dd94cafb699a4 (patch)
tree9082e87d577f71e7fb362ecb5117d618f932aeda /src/cmd/compile/testdata/script
parent5d040df09271ad2f1b0f93abf94a1b2efc8871df (diff)
downloadgo-fde10c4ce7f3b32acd886992450dd94cafb699a4.tar.xz
runtime: split gcMarkWorkAvailable into two separate conditions
Right now, gcMarkWorkAvailable is used in two scenarios. The first is critical: we use it to determine whether we're approaching mark termination, and it's crucial to reaching a fixed point across the ragged barrier in gcMarkDone. The second is a heuristic: should we spin up another GC worker? This change splits gcMarkWorkAvailable into these two separate conditions. This change also deduplicates the logic for updating work.nwait into more abstract helpers "gcBeginWork" and "gcEndWork." This change is solely refactoring, and should be a no-op. There are only two functional changes: - work.nwait is incremented after setting pp.gcMarkWorkerMode in the background worker code. I don't believe this change is observable except if the code fails to update work.nwait (either it results in a non-sensical number, or the stack is corrupted) in which case the goroutine may not be labeled as a mark worker in the resulting stack trace (it should be obvious from the stack frames though). - endCheckmarks also checks work.nwait == work.nproc, which should be fine since we never mutate work.nwait on that path. That extra check should be a no-op. Splitting these two use-cases for gcMarkWorkAvailable is conceptually helpful, and the checks may also diverge from Green Tea once we get rid of the global span queue. Change-Id: I0bec244a14ee82919c4deb7c1575589c0dca1089 Reviewed-on: https://go-review.googlesource.com/c/go/+/701176 Reviewed-by: Michael Pratt <mpratt@google.com> Auto-Submit: Michael Knyszek <mknyszek@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/cmd/compile/testdata/script')
0 files changed, 0 insertions, 0 deletions