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

Issue 7455049: code review 7455049: runtime: use lock-free ring for work scheduling

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 2 months ago by dho
Modified:
12 years, 4 months ago
Reviewers:
minux1, rsc, dave, matthew.horsnell, remyoudompheng, dvyukov
CC:
golang-codereviews
Visibility:
Public.

Description

runtime: use lock-free ring for work scheduling The algorithm used is based on the implementation in Concurrency Kit (http://concurrencykit.org). The ring has single producer, multiple consumer access semantics; is wait-free on insert and lock-free on retrieval. The size must be a power of 2. This changeset removes the work stealing code; it may be possible to add that back, but it is a bit hairy. When a P's ring is full, the G "overflows" into the global run queue.

Patch Set 1 #

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

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

Total comments: 22
Unified diffs Side-by-side diffs Delta from patch set Stats (+227 lines, -209 lines) Patch
M src/pkg/runtime/asm_386.s View 1 2 chunks +31 lines, -0 lines 0 comments Download
M src/pkg/runtime/asm_amd64.s View 1 2 chunks +30 lines, -0 lines 0 comments Download
M src/pkg/runtime/asm_arm.s View 1 1 chunk +31 lines, -0 lines 0 comments Download
M src/pkg/runtime/atomic_arm.c View 1 1 chunk +13 lines, -0 lines 0 comments Download
M src/pkg/runtime/export_test.go View 1 1 chunk +0 lines, -2 lines 0 comments Download
M src/pkg/runtime/proc.c View 1 22 chunks +75 lines, -197 lines 17 comments Download
M src/pkg/runtime/proc_test.go View 1 1 chunk +0 lines, -4 lines 0 comments Download
M src/pkg/runtime/runtime.h View 1 3 chunks +9 lines, -6 lines 5 comments Download
M src/pkg/runtime/sys_freebsd_arm.s View 1 1 chunk +3 lines, -0 lines 0 comments Download
M src/pkg/runtime/sys_linux_arm.s View 1 1 chunk +32 lines, -0 lines 0 comments Download
M src/pkg/runtime/sys_netbsd_arm.s View 1 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 23
dho
Hello dvyukov@google.com, rsc@golang.org, minux.ma@gmail.com, dave@cheney.net (cc: golang-dev@googlegroups.com), I'd like you to review this change to ...
13 years, 2 months ago (2013-03-04 18:43:48 UTC) #1
dho
I haven't tested this on ARM yet; I'm not sure if it compiles. This algorithm ...
13 years, 2 months ago (2013-03-04 18:52:07 UTC) #2
remyoudompheng
2013/3/4 Devon H. O'Dell <devon.odell@gmail.com>: > BenchmarkReaderCopyOptimal 1509 1534 +1.66% > BenchmarkReaderCopyUnoptimal 7562 5602 -25.92% ...
13 years, 2 months ago (2013-03-04 18:55:46 UTC) #3
remyoudompheng
2013/3/4 Rémy Oudompheng <remyoudompheng@gmail.com>: > 2013/3/4 Devon H. O'Dell <devon.odell@gmail.com>: >> BenchmarkReaderCopyOptimal 1509 1534 +1.66% ...
13 years, 2 months ago (2013-03-04 19:20:56 UTC) #4
dho
2013/3/4 Rémy Oudompheng <remyoudompheng@gmail.com>: > 2013/3/4 Rémy Oudompheng <remyoudompheng@gmail.com>: >> 2013/3/4 Devon H. O'Dell <devon.odell@gmail.com>: ...
13 years, 2 months ago (2013-03-04 19:24:52 UTC) #5
remyoudompheng
2013/3/4 Devon H. O'Dell <devon.odell@gmail.com>: > 2013/3/4 Rémy Oudompheng <remyoudompheng@gmail.com>: >> 2013/3/4 Rémy Oudompheng <remyoudompheng@gmail.com>: ...
13 years, 2 months ago (2013-03-04 19:39:11 UTC) #6
rsc
Devon, Thanks for working on this. Have you coordinated with Dmitriy about this? I don't ...
13 years, 2 months ago (2013-03-04 19:54:43 UTC) #7
dho
2013/3/4 Russ Cox <rsc@golang.org>: > Devon, > > Thanks for working on this. Have you ...
13 years, 2 months ago (2013-03-04 19:57:20 UTC) #8
dvyukov
https://codereview.appspot.com/7455049/diff/4001/src/pkg/runtime/proc.c File src/pkg/runtime/proc.c (right): https://codereview.appspot.com/7455049/diff/4001/src/pkg/runtime/proc.c#newcode279 src/pkg/runtime/proc.c:279: if (runqput(m->p, gp) == false) { Perhaps combine it ...
13 years, 2 months ago (2013-03-08 18:23:27 UTC) #9
dho
Hi, Haven't had a lot of time to fix this recently but I wanted to ...
13 years, 2 months ago (2013-03-12 15:38:43 UTC) #10
rsc
The C compiler does not inline.
13 years, 2 months ago (2013-03-12 15:45:10 UTC) #11
dho
2013/3/12 Russ Cox <rsc@golang.org>: > The C compiler does not inline. Maybe we should revisit ...
13 years, 2 months ago (2013-03-12 15:50:25 UTC) #12
rsc
On Tue, Mar 12, 2013 at 11:50 AM, Devon H. O'Dell <devon.odell@gmail.com>wrote: > 2013/3/12 Russ ...
13 years, 2 months ago (2013-03-12 15:56:01 UTC) #13
dho
2013/3/12 Russ Cox <rsc@golang.org>: > On Tue, Mar 12, 2013 at 11:50 AM, Devon H. ...
13 years, 2 months ago (2013-03-12 16:07:28 UTC) #14
dvyukov
On Tue, Mar 12, 2013 at 7:38 PM, Devon H. O'Dell <devon.odell@gmail.com> wrote: >> https://codereview.appspot.com/7455049/diff/4001/src/pkg/runtime/proc.c#newcode279 ...
13 years, 2 months ago (2013-03-12 16:18:01 UTC) #15
dvyukov
On Tue, Mar 12, 2013 at 8:07 PM, Devon H. O'Dell <devon.odell@gmail.com> wrote: > 2013/3/12 ...
13 years, 2 months ago (2013-03-12 16:21:32 UTC) #16
rsc
On Tue, Mar 12, 2013 at 12:07 PM, Devon H. O'Dell <devon.odell@gmail.com>wrote: > 2013/3/12 Russ ...
13 years, 2 months ago (2013-03-12 16:26:09 UTC) #17
dvyukov
On Tue, Mar 12, 2013 at 8:26 PM, Russ Cox <rsc@golang.org> wrote: > On Tue, ...
13 years, 2 months ago (2013-03-12 16:37:36 UTC) #18
matthew.horsnell_gmail.com
Late to the party, but keen to test this change list. I am trying to ...
13 years, 2 months ago (2013-03-13 21:55:52 UTC) #19
rsc
No, it doesn't. You can use WORD $0x12345678 with the constant corrected. Russ
13 years, 2 months ago (2013-03-13 22:00:50 UTC) #20
rsc
I'd like to leave this until after Go 1.1.
13 years, 2 months ago (2013-03-19 18:38:50 UTC) #21
gobot
Replacing golang-dev with golang-codereviews.
12 years, 5 months ago (2013-12-20 16:21:43 UTC) #22
dvyukov
12 years, 4 months ago (2014-01-01 09:09:03 UTC) #23
Sign in to reply to this message.

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