]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: allow all of the preamble to be preemptible
authorKeith Randall <khr@golang.org>
Tue, 11 Feb 2025 23:02:08 +0000 (15:02 -0800)
committerKeith Randall <khr@golang.org>
Fri, 25 Apr 2025 19:21:48 +0000 (12:21 -0700)
commit3f3782feed6e0726ddb08afd32dad7d94fbb38c6
tree1fdceec931e4169b405a1909f624b7987b1adc6b
parentdc1e255104f3fee2589da61b7fa80627beb885f4
cmd/compile: allow all of the preamble to be preemptible

We currently make some parts of the preamble unpreemptible because
it confuses morestack. See comments in the code.

Instead, have morestack handle those weird cases so we can
remove unpreemptible marks from most places.

This CL makes user functions preemptible everywhere if they have no
write barriers (at least, on x86). In cmd/go the fraction of functions
that need preemptible markings drops from 82% to 36%. Makes the cmd/go
binary 0.3% smaller.

Update #35470

Change-Id: Ic83d5eabfd0f6d239a92e65684bcce7e67ff30bb
Reviewed-on: https://go-review.googlesource.com/c/go/+/648518
Auto-Submit: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
12 files changed:
src/cmd/internal/obj/arm/obj5.go
src/cmd/internal/obj/arm64/obj7.go
src/cmd/internal/obj/loong64/obj.go
src/cmd/internal/obj/mips/obj0.go
src/cmd/internal/obj/plist.go
src/cmd/internal/obj/ppc64/obj9.go
src/cmd/internal/obj/riscv/obj.go
src/cmd/internal/obj/s390x/objz.go
src/cmd/internal/obj/x86/obj6.go
src/runtime/preempt.go
src/runtime/runtime2.go
src/runtime/stack.go