public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <iant@golang.org>
To: gcc-patches <gcc-patches@gcc.gnu.org>, gofrontend-dev@googlegroups.com
Subject: libgo patch committed: Check for preemption in fast syscall return
Date: Tue, 20 Feb 2018 15:30:00 -0000	[thread overview]
Message-ID: <CAOyqgcV5oYjB3mEq5O858UpidYnxYvxUsocyZ31DGjGWPabwng@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 258 bytes --]

This libgo patch checks for preemption in the fast return path from a
system call.  This helps with tight loops that make system calls, as
in BenchmarkSyscallExcessWork.  Bootstrapped and ran Go testsuite on
x86_64-pc-linux-gnu.  Committed to mainline.

Ian

[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 862 bytes --]

Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE	(revision 257845)
+++ gcc/go/gofrontend/MERGE	(working copy)
@@ -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: libgo/go/runtime/proc.go
===================================================================
--- libgo/go/runtime/proc.go	(revision 257743)
+++ libgo/go/runtime/proc.go	(working copy)
@@ -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
 	}
 

                 reply	other threads:[~2018-02-20 15:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOyqgcV5oYjB3mEq5O858UpidYnxYvxUsocyZ31DGjGWPabwng@mail.gmail.com \
    --to=iant@golang.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gofrontend-dev@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).