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

Issue 107670043: code review 107670043: cmd/gc: allocate select descriptor on stack (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 9 months ago by dvyukov
Modified:
9 years, 9 months ago
Reviewers:
aram, gobot, khr, rsc, 0intro
CC:
golang-codereviews, rsc, Dominik Honnef, khr, remyoudompheng
Visibility:
Public.

Description

cmd/gc: allocate select descriptor on stack benchmark old ns/op new ns/op delta BenchmarkSelectUncontended 220 165 -25.00% BenchmarkSelectContended 209 161 -22.97% BenchmarkSelectProdCons 1042 904 -13.24% But more importantly this change will allow to get rid of free function in runtime. Fixes issue 6494.

Patch Set 1 #

Patch Set 2 : diff -r f488ce00f55c https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 3 : diff -r c664b9859a18 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 4 : diff -r c664b9859a18 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 5 : diff -r c664b9859a18 https://dvyukov%40google.com@code.google.com/p/go/ #

Total comments: 2

Patch Set 6 : diff -r c664b9859a18 https://dvyukov%40google.com@code.google.com/p/go/ #

Total comments: 3

Patch Set 7 : diff -r c5aaab784278 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 8 : diff -r c5aaab784278 https://dvyukov%40google.com@code.google.com/p/go/ #

Total comments: 1

Patch Set 9 : diff -r c29c82b55ac0 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 10 : diff -r c29c82b55ac0 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 11 : diff -r c29c82b55ac0 https://dvyukov%40google.com@code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+99 lines, -40 lines) Patch
M src/cmd/gc/builtin.c View 1 chunk +1 line, -1 line 0 comments Download
M src/cmd/gc/runtime.go View 1 chunk +1 line, -1 line 0 comments Download
M src/cmd/gc/select.c View 5 chunks +59 lines, -3 lines 0 comments Download
M src/pkg/runtime/arch_386.h View 1 chunk +2 lines, -1 line 0 comments Download
M src/pkg/runtime/arch_amd64.h View 1 chunk +2 lines, -1 line 0 comments Download
M src/pkg/runtime/arch_amd64p32.h View 1 chunk +2 lines, -1 line 0 comments Download
M src/pkg/runtime/arch_arm.h View 1 chunk +2 lines, -1 line 0 comments Download
M src/pkg/runtime/chan.h View 3 chunks +7 lines, -1 line 0 comments Download
M src/pkg/runtime/chan.goc View 4 chunks +20 lines, -27 lines 0 comments Download
M test/live.go View 3 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 27
dvyukov
Hello golang-codereviews@googlegroups.com (cc: khr@golang.org, remyoudompheng@gmail.com, rsc@golang.org), I'd like you to review this change to https://dvyukov%40google.com@code.google.com/p/go/
9 years, 9 months ago (2014-07-09 13:51:45 UTC) #1
rsc
https://codereview.appspot.com/107670043/diff/80001/src/pkg/runtime/chan.goc File src/pkg/runtime/chan.goc (right): https://codereview.appspot.com/107670043/diff/80001/src/pkg/runtime/chan.goc#newcode991 src/pkg/runtime/chan.goc:991: sel = runtime·mallocgc(selectsize(cases.len), 0, FlagNoScan); Why is it FlagNoScan? ...
9 years, 9 months ago (2014-07-09 17:44:38 UTC) #2
Dominik Honnef
Updates/fixes issue 6494?
9 years, 9 months ago (2014-07-09 17:50:23 UTC) #3
dvyukov
https://codereview.appspot.com/107670043/diff/80001/src/pkg/runtime/chan.goc File src/pkg/runtime/chan.goc (right): https://codereview.appspot.com/107670043/diff/80001/src/pkg/runtime/chan.goc#newcode991 src/pkg/runtime/chan.goc:991: sel = runtime·mallocgc(selectsize(cases.len), 0, FlagNoScan); On 2014/07/09 17:44:38, rsc ...
9 years, 9 months ago (2014-07-09 17:55:55 UTC) #4
dvyukov
On 2014/07/09 17:50:23, Dominik Honnef wrote: > Updates/fixes issue 6494? done
9 years, 9 months ago (2014-07-09 17:57:15 UTC) #5
rsc
https://codereview.appspot.com/107670043/diff/100001/src/pkg/runtime/chan.goc File src/pkg/runtime/chan.goc (right): https://codereview.appspot.com/107670043/diff/100001/src/pkg/runtime/chan.goc#newcode991 src/pkg/runtime/chan.goc:991: sel = runtime·mallocgc(selectsize(cases.len), 0, 0); What does 0 mean ...
9 years, 9 months ago (2014-07-09 18:34:43 UTC) #6
dvyukov
On 2014/07/09 18:34:43, rsc wrote: > https://codereview.appspot.com/107670043/diff/100001/src/pkg/runtime/chan.goc > File src/pkg/runtime/chan.goc (right): > > https://codereview.appspot.com/107670043/diff/100001/src/pkg/runtime/chan.goc#newcode991 > ...
9 years, 9 months ago (2014-07-09 18:39:18 UTC) #7
dvyukov
On 2014/07/09 18:39:18, dvyukov wrote: > On 2014/07/09 18:34:43, rsc wrote: > > https://codereview.appspot.com/107670043/diff/100001/src/pkg/runtime/chan.goc > ...
9 years, 9 months ago (2014-07-16 19:37:21 UTC) #8
dvyukov
PTAL https://codereview.appspot.com/107670043/diff/100001/src/pkg/runtime/chan.goc File src/pkg/runtime/chan.goc (right): https://codereview.appspot.com/107670043/diff/100001/src/pkg/runtime/chan.goc#newcode991 src/pkg/runtime/chan.goc:991: sel = runtime·mallocgc(selectsize(cases.len), 0, 0); On 2014/07/09 18:34:43, ...
9 years, 9 months ago (2014-07-18 16:19:16 UTC) #9
rsc
LGTM but - put FlagNoScan back - add comments as indicated - wait for khr ...
9 years, 9 months ago (2014-07-18 16:19:18 UTC) #10
dvyukov
All done. Keith, I am waiting for you.
9 years, 9 months ago (2014-07-18 16:41:48 UTC) #11
khr
LGTM. https://codereview.appspot.com/107670043/diff/140001/src/cmd/gc/select.c File src/cmd/gc/select.c (right): https://codereview.appspot.com/107670043/diff/140001/src/cmd/gc/select.c#newcode329 src/cmd/gc/select.c:329: // Keep in sync with src/pkg/runtime/chan.h. I'm not ...
9 years, 9 months ago (2014-07-18 19:53:43 UTC) #12
dvyukov
*** Submitted as https://code.google.com/p/go/source/detail?r=e1d0077340e8 *** cmd/gc: allocate select descriptor on stack benchmark old ns/op new ...
9 years, 9 months ago (2014-07-20 11:07:13 UTC) #13
dvyukov
On 2014/07/18 19:53:43, khr wrote: > LGTM. > > https://codereview.appspot.com/107670043/diff/140001/src/cmd/gc/select.c > File src/cmd/gc/select.c (right): > ...
9 years, 9 months ago (2014-07-20 11:13:52 UTC) #14
dvyukov
On 2014/07/18 19:53:43, khr wrote: > LGTM. > > https://codereview.appspot.com/107670043/diff/140001/src/cmd/gc/select.c > File src/cmd/gc/select.c (right): > ...
9 years, 9 months ago (2014-07-20 11:13:53 UTC) #15
gobot
This CL appears to have broken the plan9-386-cnielsen builder. See http://build.golang.org/log/f7da638a20544ef7f45e81f23fdbc4875044c296
9 years, 9 months ago (2014-07-20 11:52:55 UTC) #16
dvyukov
On Sun, Jul 20, 2014 at 3:52 PM, <gobot@golang.org> wrote: > This CL appears to ...
9 years, 9 months ago (2014-07-20 11:58:47 UTC) #17
0intro
> The crash looks related, but I don't understand why it happened only > on ...
9 years, 9 months ago (2014-07-20 12:06:04 UTC) #18
dvyukov
On Sun, Jul 20, 2014 at 4:06 PM, David du Colombier <0intro@gmail.com> wrote: >> The ...
9 years, 9 months ago (2014-07-20 12:12:58 UTC) #19
aram
> The crash looks related, but I don't understand why it happened only > on ...
9 years, 9 months ago (2014-07-20 12:57:30 UTC) #20
dvyukov
On Sun, Jul 20, 2014 at 4:57 PM, <aram@mgk.ro> wrote: >> The crash looks related, ...
9 years, 9 months ago (2014-07-20 13:17:38 UTC) #21
aram
The pointer it complains about, 0x1164, is the return address for the call to runtime·selectsend ...
9 years, 9 months ago (2014-07-20 13:31:18 UTC) #22
dvyukov
On Sun, Jul 20, 2014 at 5:30 PM, Aram Hăvărneanu <aram@mgk.ro> wrote: > The pointer ...
9 years, 9 months ago (2014-07-20 13:45:26 UTC) #23
aram
Yes, text is mapped at 0x1000 on plan9/386. -- Aram Hăvărneanu
9 years, 9 months ago (2014-07-20 13:46:53 UTC) #24
dvyukov
Ah, OK, I see. We put PC into select descriptor and mark that slot as ...
9 years, 9 months ago (2014-07-20 14:04:53 UTC) #25
0intro
> Ah, OK, I see. We put PC into select descriptor and mark that slot ...
9 years, 9 months ago (2014-07-20 14:14:11 UTC) #26
dvyukov
9 years, 9 months ago (2014-07-20 14:31:34 UTC) #27
thanks! mailed it

On Sun, Jul 20, 2014 at 6:14 PM, David du Colombier <0intro@gmail.com> wrote:
>> Ah, OK, I see. We put PC into select descriptor and mark that slot as
>> pointer. Please try the following patch:
>> https://codereview.appspot.com/113350043
>
> Yes, this patch fixes the issue.
>
> Thank you both.
>
> --
> David du Colombier
Sign in to reply to this message.

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