runtime: allow preemption in fast syscall return
authorIan Lance Taylor <ian@gcc.gnu.org>
Tue, 20 Feb 2018 15:30:31 +0000 (15:30 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Tue, 20 Feb 2018 15:30:31 +0000 (15:30 +0000)
    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

gcc/go/gofrontend/MERGE
libgo/go/runtime/proc.go

index 61bed68afca6c6a1d14bedbf26a60297cdaafd94..c52bf4e0dc0c7f97622df15e5015a084c5217cb2 100644 (file)
@@ -1,4 +1,4 @@
-459a8a94e04a19bde7173ef7cf2db369c2e62e2d
+c6e0970f75508e209a10a7db5164d6ea3f9b28bf
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index 1d95109d7c0cbc388800e94d820f324510c3c895..20fa0ad05be17caa494a37495e61c510da4f118f 100644 (file)
@@ -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
        }