* libgo patch committed: Mark dropm and callees nowritebarrierrec
@ 2017-06-22 22:11 Ian Lance Taylor
0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2017-06-22 22:11 UTC (permalink / raw)
To: gcc-patches, gofrontend-dev
[-- Attachment #1: Type: text/plain, Size: 236 bytes --]
The CgocallbackDone function calls dropm after it calls entersyscall,
which means that dropm must not have any write barriers. Mark it
accordingly. Bootstrapped and ran Go testsuite on
x86_64-pc-linux-gnu. Committed to mainline.
Ian
[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 2370 bytes --]
Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE (revision 249576)
+++ gcc/go/gofrontend/MERGE (working copy)
@@ -1,4 +1,4 @@
-55b2b2dee55bd495a770347daaf858634057ecb0
+c5aa42107d116c9121de447d214297c88dd9f5fa
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
Index: libgo/go/runtime/os_gccgo.go
===================================================================
--- libgo/go/runtime/os_gccgo.go (revision 249205)
+++ libgo/go/runtime/os_gccgo.go (working copy)
@@ -32,6 +32,7 @@ func minit() {
// Called from dropm to undo the effect of an minit.
//go:nosplit
+//go:nowritebarrierrec
func unminit() {
unminitSignals()
}
Index: libgo/go/runtime/proc.go
===================================================================
--- libgo/go/runtime/proc.go (revision 249576)
+++ libgo/go/runtime/proc.go (working copy)
@@ -1447,6 +1447,9 @@ func oneNewExtraM() {
// in which dropm happens on each cgo call, is still correct too.
// We may have to keep the current version on systems with cgo
// but without pthreads, like Windows.
+//
+// CgocallBackDone calls this after releasing p, so no write barriers.
+//go:nowritebarrierrec
func dropm() {
// Clear m and g, and return m to the extra list.
// After the call to setg we can only call nosplit functions
@@ -1492,6 +1495,7 @@ var extraMWaiters uint32
// return a nil list head if that's what it finds. If nilokay is false,
// lockextra will keep waiting until the list head is no longer nil.
//go:nosplit
+//go:nowritebarrierrec
func lockextra(nilokay bool) *m {
const locked = 1
@@ -1524,6 +1528,7 @@ func lockextra(nilokay bool) *m {
}
//go:nosplit
+//go:nowritebarrierrec
func unlockextra(mp *m) {
atomic.Storeuintptr(&extram, uintptr(unsafe.Pointer(mp)))
}
Index: libgo/go/runtime/signal_unix.go
===================================================================
--- libgo/go/runtime/signal_unix.go (revision 249205)
+++ libgo/go/runtime/signal_unix.go (working copy)
@@ -599,6 +599,7 @@ func minitSignalMask() {
// unminitSignals is called from dropm, via unminit, to undo the
// effect of calling minit on a non-Go thread.
//go:nosplit
+//go:nowritebarrierrec
func unminitSignals() {
if getg().m.newSigstack {
signalstack(nil, 0)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-06-22 22:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-22 22:11 libgo patch committed: Mark dropm and callees nowritebarrierrec Ian Lance Taylor
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).