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

Issue 140950043: code review 140950043: runtime: make entersyscall/exitsyscall safe for stack splits (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 6 months ago by rsc
Modified:
10 years, 6 months ago
Reviewers:
gobot, dave, iant
CC:
golang-codereviews, iant, dvyukov, khr, r, gobot
Visibility:
Public.

Description

runtime: make entersyscall/exitsyscall safe for stack splits It is fundamentally unsafe to grow the stack once someone has made a call to syscall.Syscall. That function takes 6 uintptr arguments, but depending on the call some are pointers. In fact, some might be pointers to stack values, and we don't know which. That makes it impossible to copy the stack somewhere else. Since we want to delete all the stack splitting code, relying only on stack copying, make sure that Syscall never needs to split the stack. The only thing Syscall does is: call entersyscall make the system call call exitsyscall As long as we make sure that entersyscall and exitsyscall can live in the nosplit region, they won't ask for more stack. Do this by making entersyscall and exitsyscall set up the stack guard so that any call to a function with a split check will cause a crash. Then move non-essential slow-path work onto the m stack using onM and mark the rest of the work nosplit. The linker will verify that the chain of nosplits fits in the total nosplit budget.

Patch Set 1 #

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

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

Total comments: 6

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+141 lines, -59 lines) Patch
M src/pkg/runtime/proc.c View 1 2 3 11 chunks +138 lines, -58 lines 0 comments Download
M src/pkg/runtime/runtime.h View 1 2 chunks +1 line, -1 line 0 comments Download
M src/pkg/runtime/stack.c View 1 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 9
rsc
Hello golang-codereviews@googlegroups.com (cc: dvyukov, iant, khr, r), I'd like you to review this change to ...
10 years, 6 months ago (2014-09-03 20:06:40 UTC) #1
iant
LGTM https://codereview.appspot.com/140950043/diff/40001/src/pkg/runtime/proc.c File src/pkg/runtime/proc.c (right): https://codereview.appspot.com/140950043/diff/40001/src/pkg/runtime/proc.c#newcode436 src/pkg/runtime/proc.c:436: isscanstatus(uint32 status) You can now delete isscanstatus. It's ...
10 years, 6 months ago (2014-09-03 20:23:37 UTC) #2
rsc
*** Submitted as https://code.google.com/p/go/source/detail?r=7701aaba295b *** runtime: make entersyscall/exitsyscall safe for stack splits It is fundamentally ...
10 years, 6 months ago (2014-09-03 21:42:42 UTC) #3
iant
On Wed, Sep 3, 2014 at 2:42 PM, <rsc@golang.org> wrote: > On 2014/09/03 20:23:37, iant ...
10 years, 6 months ago (2014-09-03 21:44:21 UTC) #4
gobot
This CL appears to have broken the windows-amd64-perf builder. See http://build.golang.org/log/959bf9be0135b2dba67066dcd29fbbc2c381ac20
10 years, 6 months ago (2014-09-03 21:45:18 UTC) #5
gobot
R=
10 years, 6 months ago (2014-09-04 01:50:29 UTC) #6
gobot
I am a dumb robot. —gobot
10 years, 6 months ago (2014-09-04 01:51:04 UTC) #7
rsc
Sorry for the spam. Testing the CL poster for adg. On Wed, Sep 3, 2014 ...
10 years, 6 months ago (2014-09-04 01:58:04 UTC) #8
dave_cheney.net
10 years, 6 months ago (2014-09-04 01:59:24 UTC) #9
Gotta be careful with those uft-8 characters where python is concerned.

On Thu, Sep 4, 2014 at 11:58 AM, Russ Cox <rsc@golang.org> wrote:
> Sorry for the spam. Testing the CL poster for adg.
>
> On Wed, Sep 3, 2014 at 9:51 PM, <gobot@golang.org> wrote:
>>
>> I am a dumb robot.
>>
>> --gobot
>
>
> While I'm here, WTF? I sent Rietveld —gobot and it turned into --gobot.
> Sigh.
>
> Russ
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-codereviews" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-codereviews+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Sign in to reply to this message.

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