From 911cef2e3ba7548ee13e761f88457c6bbe1fa7fe Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 20 Feb 2018 15:30:31 +0000 Subject: 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. Reviewed-on: https://go-review.googlesource.com/94895 From-SVN: r257848 --- libgo/go/runtime/proc.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libgo') 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 @@ func exitsyscall(dummy int32) { 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 } -- cgit v1.1