aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/stack.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2025-05-05 10:51:52 -0700
committerGopher Robot <gobot@golang.org>2025-05-05 13:08:27 -0700
commitfa2bb342d7b0024440d996c2d6d6778b7a5e0247 (patch)
treec64fe4b39f32fbca02ee89e22f54fb9e991a828c /src/runtime/stack.go
parent6729fbe93e535080e9e050b3ca0a80ab407dbacc (diff)
downloadgo-fa2bb342d7b0024440d996c2d6d6778b7a5e0247.tar.xz
Revert "cmd/compile: allow all of the preamble to be preemptible"
This reverts commits 3f3782feed6e0726ddb08afd32dad7d94fbb38c6 (CL 648518) b386b628521780c048af14a148f373c84e687b26 (CL 668475) Fixes #73542 Change-Id: I218851c5c0b62700281feb0b3f82b6b9b97b910d Reviewed-on: https://go-review.googlesource.com/c/go/+/670055 Reviewed-by: Keith Randall <khr@google.com> Auto-Submit: Keith Randall <khr@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/runtime/stack.go')
-rw-r--r--src/runtime/stack.go23
1 files changed, 0 insertions, 23 deletions
diff --git a/src/runtime/stack.go b/src/runtime/stack.go
index 67a394cd12..2fedaa9421 100644
--- a/src/runtime/stack.go
+++ b/src/runtime/stack.go
@@ -1075,29 +1075,6 @@ func newstack() {
gopreempt_m(gp) // never return
}
- if stackguard0 == gp.stack.lo+stackGuard && gp.preemptRecent {
- // The case happens because of an interaction between synchronous
- // and asynchronous preemption. First, we set the cooperative
- // preemption signal (g.stackguard0 = stackPreempt), and as a
- // result the function fails the stack check and enters its
- // morestack path. If it gets suspended at that point, we might
- // give up waiting for it and send an async preempt. That async
- // preempt gets processed and clears the cooperative preemption
- // signal (g.stackguard0 = g.stack.lo+stackGuard) and resumes
- // the function. But even though the cooperative preemption
- // signal is cleared, we're already on the morestack path and
- // can't avoid calling morestack. See issue 35470.
- //
- // To avoid this problem, if we've been preempted recently,
- // clear the "preempted recently" flag and resume the G.
- // If we really did need more stack, the morestack check will
- // immediately fail and we'll get back here to try again (with
- // preemptRecent==false, so we don't take this case the
- // second time).
- gp.preemptRecent = false
- gogo(&gp.sched) // never return
- }
-
// Allocate a bigger segment and move the stack.
oldsize := gp.stack.hi - gp.stack.lo
newsize := oldsize * 2