runtime: allow preemption in fast syscall return
Let a fast syscall return be a preemption point. This helps with
tight loops that make system calls, as in BenchmarkSyscallExcessWork.
Change-Id: I9c723398cf1678afb70ca8281e9aa0339b98b8dc
Reviewed-on: https://go-review.googlesource.com/94895
Reviewed-by: Than McIntosh <thanm@google.com>
diff --git a/libgo/go/runtime/proc.go b/libgo/go/runtime/proc.go
index 1d95109..20fa0ad 100644
--- a/libgo/go/runtime/proc.go
+++ b/libgo/go/runtime/proc.go
@@ -2794,6 +2794,13 @@
exitsyscallclear(_g_)
_g_.m.locks--
_g_.throwsplit = false
+
+ // Check preemption, since unlike gc we don't check on
+ // every call.
+ if getg().preempt {
+ checkPreempt()
+ }
+
return
}