[go: up one dir, main page]

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

Issue 171680043: [dev.cc] code review 171680043: runtime: make lock-free stack work with high canonical amd64

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 2 months ago by aram
Modified:
11 years, 2 months ago
Reviewers:
rsc
CC:
brad, dave_cheney.net, dvyukov, golang-codereviews, iant, khr, minux, rlh
Visibility:
Public.

Description

runtime: make lock-free stack work with high canonical amd64 addresses On most amd64 systems, all user-space addresses are in the lower canonical half (most significant 16-bits set to zero) and all kernel-space addresses are in the upper canonical half (most significant 16-bits set to one). Solaris is an exception to this, user-space addresses are in both canonical halves. The heap, text, and anonymous memory mappings are in the lower half, but the stack and shared object mappings are in the top half. The lock-free stack algorithm uses the most significant unused bits in an address for the ABA counter. The algorithm used to assume all addresses are in the lower canonical half; it used all 16+1bit unused space and created pointers with top 16+1 bits set to zero. The behavior is unchanged on non-Solaris systems. On Solaris, only 15 bits are used for ABA counter, and the 49th bit is used to keep track if a pointer originated from low or high memory. When the algorithm re-creates a pointer, it now makes sure the most significant 16 bits are a copy of the 49th bit. This change almost fixes the Solaris build, runtime tests pass except for the crash handler test, which will be addressed in a different CL

Patch Set 1 #

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

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+54 lines, -9 lines) Patch
M src/runtime/lfstack.go View 1 2 chunks +5 lines, -5 lines 0 comments Download
M src/runtime/lfstack_32bit.go View 1 1 chunk +11 lines, -0 lines 0 comments Download
M src/runtime/lfstack_amd64.go View 1 2 chunks +15 lines, -0 lines 0 comments Download
M src/runtime/lfstack_solaris_amd64.go View 1 1 chunk +23 lines, -4 lines 0 comments Download

Messages

Total messages: 11
aram
Hello rsc (cc: brad, dfc, dvyukov, golang-codereviews@googlegroups.com, iant, khr, minux, rlh), I'd like you to ...
11 years, 2 months ago (2014-11-13 20:47:05 UTC) #1
aram
I tested this on solaris/amd64, linux/amd64 and linux/386.
11 years, 2 months ago (2014-11-13 20:48:03 UTC) #2
rsc
i'll try something different tomorrow and send a counterproposal.
11 years, 2 months ago (2014-11-14 02:21:45 UTC) #3
aram
Note that if we make the code a little more complicated, we can gain another ...
11 years, 2 months ago (2014-11-14 07:49:40 UTC) #4
rsc
On Fri, Nov 14, 2014 at 2:49 AM, <aram@mgk.ro> wrote: > Unrelated -- I'm slightly ...
11 years, 2 months ago (2014-11-14 17:02:54 UTC) #5
dvyukov
On Fri, Nov 14, 2014 at 10:49 AM, <aram@mgk.ro> wrote: > Note that if we ...
11 years, 2 months ago (2014-11-14 17:16:57 UTC) #6
rsc
Cleaner fix at CL 177750043.
11 years, 2 months ago (2014-11-14 17:30:49 UTC) #7
rsc
R=close I'd be happy to take a sparc64 file, but it has to use more ...
11 years, 2 months ago (2014-11-15 04:31:10 UTC) #8
aram
On Sat, Nov 15, 2014 at 5:31 AM, <rsc@golang.org> wrote: > I'd be happy to ...
11 years, 2 months ago (2014-11-15 10:41:38 UTC) #9
rsc
On Sat, Nov 15, 2014 at 5:41 AM, Aram Hăvărneanu <aram@mgk.ro> wrote: > On Sat, ...
11 years, 2 months ago (2014-11-15 12:45:07 UTC) #10
aram
11 years, 2 months ago (2014-11-15 13:10:01 UTC) #11
On Sat, Nov 15, 2014 at 1:45 PM, Russ Cox <rsc@golang.org> wrote:
> I was thinking about this code, and I thought that you were trying to
> support sparc64 with it. I can't actually tell.

Ah, it originated from gccgo, which does support sparc64. I'm not sure
if we need to do anything in gc. In gccgo Ian can adapt
lfstack_amd64.go to lfstack_sparc64.go. Adding lfstack_sparc64.go is
problematic because cmd/go doesn't understand GOARCH=sparc64 and we
can't test it anyway.

-- 
Aram Hăvărneanu
Sign in to reply to this message.

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