Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(20)

Issue 110680044: code review 110680044: runtime: call rfork on scheduler stack on Plan 9 (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 3 months ago by ality
Modified:
11 years, 1 month ago
Reviewers:
aram, gobot, rsc, 0intro
CC:
aram, 0intro, mischief, rsc, golang-codereviews
Visibility:
Public.

Description

runtime: call rfork on scheduler stack on Plan 9 A race exists between the parent and child processes after a fork. The child needs to access the new M pointer passed as an argument but the parent may have already returned and clobbered it. Previously, we avoided this by saving the necessary data into registers before the rfork system call but this isn't guaranteed to work because Plan 9 makes no promises about the register state after a system call. Only the 386 kernel seems to save them. For amd64 and arm, this method won't work. We eliminate the race by allocating stack space for the scheduler goroutines (g0) in the per-process copy-on-write stack segment and by only calling rfork on the scheduler stack.

Patch Set 1 #

Patch Set 2 : diff -r 66c3664bd245 https://code.google.com/p/go #

Patch Set 3 : diff -r 66c3664bd245 https://code.google.com/p/go #

Patch Set 4 : diff -r 66c3664bd245 https://code.google.com/p/go #

Patch Set 5 : diff -r 66c3664bd245 https://code.google.com/p/go #

Total comments: 5

Patch Set 6 : diff -r 66c3664bd245 https://code.google.com/p/go #

Total comments: 1

Patch Set 7 : diff -r d5c083552430 https://code.google.com/p/go #

Patch Set 8 : diff -r 1b4900565b48d0f03f4f5263116b688fbeed75f8 https://code.google.com/p/go #

Patch Set 9 : diff -r 473a2c28eb342eae133c6b91b9511afeeba04c9e https://code.google.com/p/go #

Total comments: 2

Patch Set 10 : diff -r 428dd5a62a9dad3f037c45aaf19ffecca8801b7e https://code.google.com/p/go #

Patch Set 11 : diff -r 1ad196212ec464e41a35c4bd5553bf302e8e887b https://code.google.com/p/go #

Patch Set 12 : diff -r 0eda065231ddc227a5f7ac9bb2aeed9259f8966f https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+69 lines, -71 lines) Patch
M src/runtime/os_plan9.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -1 line 0 comments Download
M src/runtime/os_plan9.c View 1 2 3 4 5 6 7 8 9 10 1 chunk +9 lines, -7 lines 0 comments Download
M src/runtime/os_plan9.go View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -1 line 0 comments Download
M src/runtime/proc.c View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -2 lines 0 comments Download
M src/runtime/runtime.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +9 lines, -0 lines 0 comments Download
M src/runtime/sys_plan9_386.s View 1 2 3 4 5 6 7 8 9 10 1 chunk +24 lines, -33 lines 0 comments Download
M src/runtime/sys_plan9_amd64.s View 1 2 3 4 5 6 7 8 9 10 1 chunk +21 lines, -27 lines 0 comments Download

Messages

Total messages: 23
aram
Thanks for working on this. I am quite confused by the use of runtime·asmcgocall. Why ...
11 years, 3 months ago (2014-07-20 10:02:24 UTC) #1
0intro
Thanks. The tests are passing successfully on 386 Plan 9. Increasing the stack to 16MB ...
11 years, 3 months ago (2014-07-20 12:53:58 UTC) #2
ality
PTAL aram@mgk.ro once said: > Thanks for working on this. > > I am quite ...
11 years, 3 months ago (2014-07-20 14:52:45 UTC) #3
aram
LGTM Let's allow for more time to test this on amd64 before comitting, though. > ...
11 years, 3 months ago (2014-07-20 15:05:51 UTC) #4
0intro
I've tried your latest change and so far it seems to work fine on 386 ...
11 years, 3 months ago (2014-07-20 16:02:01 UTC) #5
mischief
On 2014/07/20 16:02:01, 0intro wrote: > I've tried your latest change and so far it ...
11 years, 3 months ago (2014-07-21 05:35:48 UTC) #6
aram
Let's mail it, wait a few days, and ship it.
11 years, 3 months ago (2014-07-21 09:19:18 UTC) #7
0intro
> Let's mail it, wait a few days, and ship it. Agreed!
11 years, 3 months ago (2014-07-21 09:32:15 UTC) #8
aram
Ping.
11 years, 3 months ago (2014-07-23 09:21:23 UTC) #9
0intro
Ping.
11 years, 3 months ago (2014-07-25 14:27:24 UTC) #10
0intro
Ping.
11 years, 3 months ago (2014-07-31 08:21:58 UTC) #11
ality
Hello aram@mgk.ro, 0intro@gmail.com, mischief@offblast.org (cc: golang-codereviews@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go
11 years, 2 months ago (2014-08-28 08:35:56 UTC) #12
aram
LGTM
11 years, 2 months ago (2014-08-28 08:55:39 UTC) #13
0intro
LGTM We should wait for Russ, since he is currently working on the assembly files. ...
11 years, 2 months ago (2014-08-28 09:20:52 UTC) #14
0intro
And we should also submit CL 132320043 before, of course. -- David du Colombier
11 years, 2 months ago (2014-08-28 09:33:22 UTC) #15
ality
[+rsc]
11 years, 2 months ago (2014-08-28 23:08:09 UTC) #16
rsc
LGTM especially if the onM goes away but even if not https://codereview.appspot.com/110680044/diff/160001/src/pkg/runtime/os_plan9.c File src/pkg/runtime/os_plan9.c (right): ...
11 years, 2 months ago (2014-09-07 13:05:04 UTC) #17
ality
https://codereview.appspot.com/110680044/diff/160001/src/pkg/runtime/os_plan9.c File src/pkg/runtime/os_plan9.c (right): https://codereview.appspot.com/110680044/diff/160001/src/pkg/runtime/os_plan9.c#newcode294 src/pkg/runtime/os_plan9.c:294: runtime·onM(newosproc_m); On 2014/09/07 13:05:04, rsc wrote: > I don't ...
11 years, 2 months ago (2014-09-07 23:29:25 UTC) #18
rsc
okay. clearly i am misremembering. :-)
11 years, 1 month ago (2014-09-08 03:05:39 UTC) #19
ality
Russ Cox <rsc@golang.org> once said: > okay. clearly i am misremembering. :-) Now that CL ...
11 years, 1 month ago (2014-09-09 21:00:41 UTC) #20
0intro
Thanks. I've just tried your latest changes on 386 Plan 9. LGTM
11 years, 1 month ago (2014-09-09 21:14:23 UTC) #21
ality
*** Submitted as https://code.google.com/p/go/source/detail?r=208d314e61f2 *** runtime: call rfork on scheduler stack on Plan 9 A ...
11 years, 1 month ago (2014-09-10 00:19:15 UTC) #22
gobot
11 years, 1 month ago (2014-09-10 03:07:08 UTC) #23
Message was sent while issue was closed.
This CL appears to have broken the windows-amd64-perf builder.
See http://build.golang.org/log/8e72aa5354c8b07748d3b05d393c750a2c8cd430
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b