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

Issue 109050043: code review 109050043: all: remove 'extern register M *m' from runtime (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 9 months ago by rsc
Modified:
10 years, 9 months ago
Reviewers:
gobot, minux, 0intro, dvyukov, iant
CC:
minux, josharian, iant, dave_cheney.net, bradfitz, dvyukov, golang-codereviews
Visibility:
Public.

Description

all: remove 'extern register M *m' from runtime The runtime has historically held two dedicated values g (current goroutine) and m (current thread) in 'extern register' slots (TLS on x86, real registers backed by TLS on ARM). This CL removes the extern register m; code now uses g->m. On ARM, this frees up the register that formerly held m (R9). This is important for NaCl, because NaCl ARM code cannot use R9 at all. The Go 1 macrobenchmarks (those with per-op times >= 10 µs) are unaffected: BenchmarkBinaryTree17 5491374955 5471024381 -0.37% BenchmarkFannkuch11 4357101311 4275174828 -1.88% BenchmarkGobDecode 11029957 11364184 +3.03% BenchmarkGobEncode 6852205 6784822 -0.98% BenchmarkGzip 650795967 650152275 -0.10% BenchmarkGunzip 140962363 141041670 +0.06% BenchmarkHTTPClientServer 71581 73081 +2.10% BenchmarkJSONEncode 31928079 31913356 -0.05% BenchmarkJSONDecode 117470065 113689916 -3.22% BenchmarkMandelbrot200 6008923 5998712 -0.17% BenchmarkGoParse 6310917 6327487 +0.26% BenchmarkRegexpMatchMedium_1K 114568 114763 +0.17% BenchmarkRegexpMatchHard_1K 168977 169244 +0.16% BenchmarkRevcomp 935294971 914060918 -2.27% BenchmarkTemplate 145917123 148186096 +1.55% Minux previous reported larger variations, but these were caused by run-to-run noise, not repeatable slowdowns. Actual code changes by Minux. I only did the docs and the benchmarking.

Patch Set 1 #

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

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

Total comments: 102

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

Total comments: 3

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+994 lines, -957 lines) Patch
M doc/asm.html View 1 2 3 4 chunks +12 lines, -12 lines 0 comments Download
M include/link.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/cmd/5a/lex.c View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M src/cmd/dist/buildruntime.c View 1 1 chunk +0 lines, -3 lines 0 comments Download
M src/cmd/ld/data.c View 1 3 chunks +6 lines, -6 lines 0 comments Download
M src/cmd/ld/lib.c View 1 2 chunks +7 lines, -7 lines 0 comments Download
M src/cmd/ld/symtab.c View 1 1 chunk +2 lines, -2 lines 0 comments Download
M src/liblink/asm5.c View 1 2 chunks +4 lines, -4 lines 0 comments Download
M src/liblink/obj5.c View 1 1 chunk +6 lines, -6 lines 0 comments Download
M src/liblink/obj6.c View 1 1 chunk +2 lines, -2 lines 0 comments Download
M src/pkg/runtime/asm_386.s View 1 2 3 11 chunks +34 lines, -29 lines 0 comments Download
M src/pkg/runtime/asm_amd64.s View 1 2 3 15 chunks +41 lines, -30 lines 0 comments Download
M src/pkg/runtime/asm_amd64p32.s View 1 2 3 10 chunks +20 lines, -11 lines 0 comments Download
M src/pkg/runtime/asm_arm.s View 1 2 3 16 chunks +68 lines, -59 lines 0 comments Download
M src/pkg/runtime/cgo/asm_arm.s View 1 2 3 4 1 chunk +4 lines, -4 lines 0 comments Download
M src/pkg/runtime/cgo/callbacks.c View 1 1 chunk +2 lines, -2 lines 0 comments Download
M src/pkg/runtime/cgo/gcc_arm.S View 1 1 chunk +4 lines, -5 lines 0 comments Download
M src/pkg/runtime/cgo/gcc_darwin_386.c View 1 2 3 3 chunks +25 lines, -35 lines 0 comments Download
M src/pkg/runtime/cgo/gcc_darwin_amd64.c View 1 2 3 2 chunks +20 lines, -29 lines 0 comments Download
M src/pkg/runtime/cgo/gcc_dragonfly_386.c View 1 2 chunks +4 lines, -4 lines 0 comments Download
M src/pkg/runtime/cgo/gcc_dragonfly_amd64.c View 1 2 chunks +4 lines, -4 lines 0 comments Download
M src/pkg/runtime/cgo/gcc_freebsd_386.c View 1 2 chunks +4 lines, -4 lines 0 comments Download
M src/pkg/runtime/cgo/gcc_freebsd_amd64.c View 1 2 chunks +4 lines, -4 lines 0 comments Download
M src/pkg/runtime/cgo/gcc_freebsd_arm.c View 1 3 chunks +5 lines, -5 lines 0 comments Download
M src/pkg/runtime/cgo/gcc_linux_386.c View 1 2 chunks +4 lines, -4 lines 0 comments Download
M src/pkg/runtime/cgo/gcc_linux_amd64.c View 1 2 chunks +4 lines, -4 lines 0 comments Download
M src/pkg/runtime/cgo/gcc_linux_arm.c View 1 2 3 3 chunks +5 lines, -5 lines 0 comments Download
M src/pkg/runtime/cgo/gcc_netbsd_386.c View 1 2 chunks +4 lines, -4 lines 0 comments Download
M src/pkg/runtime/cgo/gcc_netbsd_amd64.c View 1 2 chunks +4 lines, -4 lines 0 comments Download
M src/pkg/runtime/cgo/gcc_netbsd_arm.c View 1 3 chunks +5 lines, -5 lines 0 comments Download
M src/pkg/runtime/cgo/gcc_openbsd_386.c View 1 3 chunks +4 lines, -4 lines 0 comments Download
M src/pkg/runtime/cgo/gcc_openbsd_amd64.c View 1 3 chunks +4 lines, -4 lines 0 comments Download
M src/pkg/runtime/cgo/gcc_windows_386.c View 1 1 chunk +1 line, -2 lines 0 comments Download
M src/pkg/runtime/cgo/gcc_windows_amd64.c View 1 1 chunk +1 line, -2 lines 0 comments Download
M src/pkg/runtime/cgo/libcgo.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M src/pkg/runtime/cgocall.c View 1 8 chunks +13 lines, -13 lines 0 comments Download
M src/pkg/runtime/heapdump.c View 1 2 chunks +4 lines, -4 lines 0 comments Download
M src/pkg/runtime/lock_futex.c View 1 7 chunks +12 lines, -12 lines 0 comments Download
M src/pkg/runtime/lock_sema.c View 1 9 chunks +28 lines, -28 lines 0 comments Download
M src/pkg/runtime/malloc.goc View 1 10 chunks +19 lines, -19 lines 0 comments Download
M src/pkg/runtime/mcache.c View 1 2 chunks +2 lines, -2 lines 0 comments Download
M src/pkg/runtime/mgc0.c View 1 2 3 20 chunks +34 lines, -34 lines 0 comments Download
M src/pkg/runtime/mheap.c View 1 7 chunks +10 lines, -10 lines 0 comments Download
M src/pkg/runtime/mprof.goc View 1 7 chunks +13 lines, -13 lines 0 comments Download
M src/pkg/runtime/netpoll_solaris.c View 1 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/runtime/netpoll_windows.c View 1 3 chunks +6 lines, -6 lines 0 comments Download
M src/pkg/runtime/os_darwin.c View 1 4 chunks +6 lines, -5 lines 0 comments Download
M src/pkg/runtime/os_dragonfly.c View 1 2 chunks +2 lines, -1 line 0 comments Download
M src/pkg/runtime/os_freebsd.c View 1 2 chunks +2 lines, -1 line 0 comments Download
M src/pkg/runtime/os_linux.c View 1 2 chunks +2 lines, -1 line 0 comments Download
M src/pkg/runtime/os_nacl.c View 1 8 chunks +15 lines, -14 lines 0 comments Download
M src/pkg/runtime/os_netbsd.c View 1 6 chunks +14 lines, -13 lines 0 comments Download
M src/pkg/runtime/os_openbsd.c View 1 4 chunks +11 lines, -10 lines 0 comments Download
M src/pkg/runtime/os_plan9.c View 1 5 chunks +6 lines, -6 lines 0 comments Download
M src/pkg/runtime/os_plan9_386.c View 1 3 chunks +4 lines, -4 lines 0 comments Download
M src/pkg/runtime/os_plan9_amd64.c View 1 3 chunks +4 lines, -4 lines 0 comments Download
M src/pkg/runtime/os_solaris.c View 1 5 chunks +19 lines, -15 lines 0 comments Download
M src/pkg/runtime/os_windows.c View 1 4 chunks +13 lines, -13 lines 0 comments Download
M src/pkg/runtime/os_windows_386.c View 1 1 chunk +2 lines, -2 lines 0 comments Download
M src/pkg/runtime/os_windows_amd64.c View 1 1 chunk +2 lines, -2 lines 0 comments Download
M src/pkg/runtime/panic.c View 1 2 3 9 chunks +27 lines, -24 lines 0 comments Download
M src/pkg/runtime/proc.c View 1 2 3 68 chunks +167 lines, -167 lines 0 comments Download
M src/pkg/runtime/race_amd64.s View 1 2 chunks +5 lines, -3 lines 0 comments Download
M src/pkg/runtime/runtime.h View 1 2 3 2 chunks +2 lines, -3 lines 0 comments Download
M src/pkg/runtime/runtime.c View 1 2 chunks +4 lines, -4 lines 0 comments Download
M src/pkg/runtime/runtime1.goc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M src/pkg/runtime/signal_386.c View 1 3 chunks +6 lines, -6 lines 0 comments Download
M src/pkg/runtime/signal_amd64x.c View 1 3 chunks +5 lines, -5 lines 0 comments Download
M src/pkg/runtime/signal_arm.c View 1 4 chunks +6 lines, -6 lines 0 comments Download
M src/pkg/runtime/signal_unix.c View 1 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/runtime/softfloat_arm.c View 1 2 3 3 chunks +9 lines, -5 lines 0 comments Download
M src/pkg/runtime/stack.c View 1 13 chunks +47 lines, -47 lines 0 comments Download
M src/pkg/runtime/symtab.goc View 1 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/runtime/sys_darwin_386.s View 1 3 chunks +5 lines, -5 lines 0 comments Download
M src/pkg/runtime/sys_darwin_amd64.s View 1 3 chunks +5 lines, -5 lines 0 comments Download
M src/pkg/runtime/sys_dragonfly_386.s View 1 3 chunks +5 lines, -5 lines 0 comments Download
M src/pkg/runtime/sys_dragonfly_amd64.s View 1 3 chunks +5 lines, -5 lines 0 comments Download
M src/pkg/runtime/sys_freebsd_386.s View 1 3 chunks +5 lines, -5 lines 0 comments Download
M src/pkg/runtime/sys_freebsd_amd64.s View 1 3 chunks +5 lines, -5 lines 0 comments Download
M src/pkg/runtime/sys_freebsd_arm.s View 1 2 3 3 chunks +8 lines, -8 lines 0 comments Download
M src/pkg/runtime/sys_linux_386.s View 1 3 chunks +5 lines, -6 lines 0 comments Download
M src/pkg/runtime/sys_linux_amd64.s View 1 3 chunks +5 lines, -5 lines 0 comments Download
M src/pkg/runtime/sys_linux_arm.s View 1 2 3 4 chunks +11 lines, -8 lines 0 comments Download
M src/pkg/runtime/sys_nacl_386.s View 1 1 chunk +5 lines, -5 lines 0 comments Download
M src/pkg/runtime/sys_nacl_amd64p32.s View 1 2 chunks +6 lines, -6 lines 0 comments Download
M src/pkg/runtime/sys_netbsd_386.s View 1 3 chunks +5 lines, -5 lines 0 comments Download
M src/pkg/runtime/sys_netbsd_amd64.s View 1 3 chunks +5 lines, -5 lines 0 comments Download
M src/pkg/runtime/sys_netbsd_arm.s View 1 2 3 3 chunks +7 lines, -6 lines 0 comments Download
M src/pkg/runtime/sys_openbsd_386.s View 1 3 chunks +5 lines, -5 lines 0 comments Download
M src/pkg/runtime/sys_openbsd_amd64.s View 1 3 chunks +5 lines, -5 lines 0 comments Download
M src/pkg/runtime/sys_plan9_386.s View 1 4 chunks +6 lines, -4 lines 0 comments Download
M src/pkg/runtime/sys_plan9_amd64.s View 1 4 chunks +6 lines, -4 lines 0 comments Download
M src/pkg/runtime/sys_solaris_amd64.s View 1 7 chunks +13 lines, -9 lines 0 comments Download
M src/pkg/runtime/sys_windows_386.s View 1 2 3 6 chunks +9 lines, -7 lines 0 comments Download
M src/pkg/runtime/sys_windows_amd64.s View 1 2 3 5 chunks +8 lines, -6 lines 0 comments Download
M src/pkg/runtime/traceback_arm.c View 1 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/runtime/traceback_x86.c View 1 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/runtime/vlop_arm.s View 1 2 3 1 chunk +10 lines, -15 lines 0 comments Download

Messages

Total messages: 32
rsc
Hello minux@golang.org (cc: golang-codereviews@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go/
10 years, 9 months ago (2014-06-16 17:23:46 UTC) #1
josharian
https://codereview.appspot.com/109050043/diff/40001/doc/asm.html File doc/asm.html (right): https://codereview.appspot.com/109050043/diff/40001/doc/asm.html#newcode152 doc/asm.html:152: (Exceptions: the <code>g</code> register renaming on ARM.) s/Exceptions/Exception/ https://codereview.appspot.com/109050043/diff/40001/src/pkg/runtime/asm_amd64.s ...
10 years, 9 months ago (2014-06-16 19:09:16 UTC) #2
iant
https://codereview.appspot.com/109050043/diff/40001/src/cmd/5a/lex.c File src/cmd/5a/lex.c (right): https://codereview.appspot.com/109050043/diff/40001/src/cmd/5a/lex.c#newcode203 src/cmd/5a/lex.c:203: "g", LREG, 10, // avoid unintentionally clobber m/g using ...
10 years, 9 months ago (2014-06-16 20:32:36 UTC) #3
dave_cheney.net
Thanks Minux and rsc. Now R9 is free, we won't have to spill a register ...
10 years, 9 months ago (2014-06-16 20:53:02 UTC) #4
bradfitz
On Mon, Jun 16, 2014 at 1:53 PM, <dave@cheney.net> wrote: > Thanks Minux and rsc. ...
10 years, 9 months ago (2014-06-16 20:55:04 UTC) #5
iant
On Mon, Jun 16, 2014 at 1:55 PM, Brad Fitzpatrick <bradfitz@golang.org> wrote: > > > ...
10 years, 9 months ago (2014-06-16 21:01:33 UTC) #6
bradfitz
On Mon, Jun 16, 2014 at 2:01 PM, Ian Lance Taylor <iant@golang.org> wrote: > On ...
10 years, 9 months ago (2014-06-16 21:04:37 UTC) #7
rsc
On Mon, Jun 16, 2014 at 1:55 PM, Brad Fitzpatrick <bradfitz@golang.org> wrote: > On Mon, ...
10 years, 9 months ago (2014-06-16 21:14:37 UTC) #8
minux
https://codereview.appspot.com/109050043/diff/40001/src/pkg/runtime/asm_386.s File src/pkg/runtime/asm_386.s (right): https://codereview.appspot.com/109050043/diff/40001/src/pkg/runtime/asm_386.s#newcode675 src/pkg/runtime/asm_386.s:675: MOVL DX, 0(SP) similarly to asm_amd64.s, we can use: ...
10 years, 9 months ago (2014-06-16 21:32:12 UTC) #9
minux
On 2014/06/16 21:14:37, rsc wrote: > On Mon, Jun 16, 2014 at 1:55 PM, Brad ...
10 years, 9 months ago (2014-06-16 21:39:40 UTC) #10
iant
On Mon, Jun 16, 2014 at 2:04 PM, Brad Fitzpatrick <bradfitz@golang.org> wrote: > On Mon, ...
10 years, 9 months ago (2014-06-16 23:07:05 UTC) #11
dvyukov
does not apply cleanly anymore: $ hg clpatch 109050043 abort: codereview issue 109050043 is out ...
10 years, 9 months ago (2014-06-17 17:34:20 UTC) #12
dvyukov
FTR, malloc become 6.4% slower on my Core2 L9600: Before: BenchmarkMalloc8 50000000 40.8 ns/op BenchmarkMalloc8 ...
10 years, 9 months ago (2014-06-17 17:52:11 UTC) #13
dvyukov
LGTM for the runtime changes
10 years, 9 months ago (2014-06-18 17:03:13 UTC) #14
rsc
On Tue, Jun 17, 2014 at 10:52 AM, <dvyukov@google.com> wrote: > FTR, malloc become 6.4% ...
10 years, 9 months ago (2014-06-18 17:09:03 UTC) #15
dvyukov
sure, that was beneficial even with separate g and m On Wed, Jun 18, 2014 ...
10 years, 9 months ago (2014-06-18 18:40:20 UTC) #16
rsc
https://codereview.appspot.com/109050043/diff/40001/doc/asm.html File doc/asm.html (right): https://codereview.appspot.com/109050043/diff/40001/doc/asm.html#newcode152 doc/asm.html:152: (Exceptions: the <code>g</code> register renaming on ARM.) On 2014/06/16 ...
10 years, 9 months ago (2014-06-24 20:08:21 UTC) #17
rsc
Hello minux@golang.org, josharian@gmail.com, iant@golang.org, dave@cheney.net, bradfitz@golang.org, dvyukov@google.com (cc: golang-codereviews@googlegroups.com), Please take another look.
10 years, 9 months ago (2014-06-24 20:08:30 UTC) #18
iant
LGTM A bunch of files have "chunk mismatch" errors in codereview, but I assume they ...
10 years, 9 months ago (2014-06-24 20:54:53 UTC) #19
minux
so what was the problem for windows? i will take another pass tonight.
10 years, 9 months ago (2014-06-25 02:37:52 UTC) #20
minux
LGTM. Thank you very much!
10 years, 9 months ago (2014-06-25 06:54:28 UTC) #21
dave_cheney.net
There is mistake in one file that is obscured by a chunk mismatch, cgo/arm_asm.s which ...
10 years, 9 months ago (2014-06-25 08:59:33 UTC) #22
dave_cheney.net
With the load_gm issue above fixed the build passes. I didn't bother doing any benchmarks, ...
10 years, 9 months ago (2014-06-25 09:31:13 UTC) #23
dave_cheney.net
With the load_gm issue above fixed the build passes on linux/arm I didn't bother doing ...
10 years, 9 months ago (2014-06-25 09:31:23 UTC) #24
rsc
Thank you for testing on ARM. I hadn't gotten around to it yet. The problem ...
10 years, 9 months ago (2014-06-26 15:15:15 UTC) #25
rsc
*** Submitted as https://code.google.com/p/go/source/detail?r=a51626d96c54 *** all: remove 'extern register M *m' from runtime The runtime ...
10 years, 9 months ago (2014-06-26 15:54:49 UTC) #26
gobot
This CL appears to have broken the plan9-386-cnielsen builder. See http://build.golang.org/log/88dfadf618aa51069214bfacebba45af4f7680d8
10 years, 9 months ago (2014-06-26 15:56:35 UTC) #27
0intro
> This CL appears to have broken the plan9-386-cnielsen builder. > See http://build.golang.org/log/88dfadf618aa51069214bfacebba45af4f7680d8 The cron ...
10 years, 9 months ago (2014-06-26 17:01:59 UTC) #28
0intro
The Plan 9 builder is back online. -- David du Colombier
10 years, 9 months ago (2014-06-26 21:52:51 UTC) #29
0intro
It seems this change breaks the Plan 9 build. term% cd /usr/go/src/pkg/time; go test -run ...
10 years, 9 months ago (2014-06-26 22:48:58 UTC) #30
0intro
Here is the builder log: http://build.golang.org/log/63b14b2d639c13caafc41b597a835e1db6910c94 -- David du Colombier
10 years, 9 months ago (2014-06-26 23:11:43 UTC) #31
minux
10 years, 9 months ago (2014-06-26 23:14:28 UTC) #32
On Jun 26, 2014 4:11 PM, "David du Colombier" <0intro@gmail.com> wrote:
>
> Here is the builder log:
>
> http://build.golang.org/log/63b14b2d639c13caafc41b597a835e1db6910c94
judged by the tests that failsed it's very likely the signal handling code
(sigtramp)  is buggy.
Sign in to reply to this message.

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