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

Issue 46810043: code review 46810043: runtime: get rid of the settype buffer and lock. MCaches (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 11 months ago by khr
Modified:
12 years, 9 months ago
Reviewers:
gobot, rsc, dvyukov
CC:
dvyukov, bradfitz, khr1, rsc, golang-codereviews
Visibility:
Public.

Description

runtime: get rid of the settype buffer and lock. MCaches now hold a MSpan for each sizeclass which they have exclusive access to allocate from, so no lock is needed. Modifying the heap bitmaps also no longer requires a cas. runtime.free gets more expensive. But we don't use it much any more. It's not much faster on 1 processor, but it's a lot faster on multiple processors. benchmark old ns/op new ns/op delta BenchmarkSetTypeNoPtr1 24 23 -0.42% BenchmarkSetTypeNoPtr2 33 34 +0.89% BenchmarkSetTypePtr1 51 49 -3.72% BenchmarkSetTypePtr2 55 54 -1.98% benchmark old ns/op new ns/op delta BenchmarkAllocation 52739 50770 -3.73% BenchmarkAllocation-2 33957 34141 +0.54% BenchmarkAllocation-3 33326 29015 -12.94% BenchmarkAllocation-4 38105 25795 -32.31% BenchmarkAllocation-5 68055 24409 -64.13% BenchmarkAllocation-6 71544 23488 -67.17% BenchmarkAllocation-7 68374 23041 -66.30% BenchmarkAllocation-8 70117 20758 -70.40%

Patch Set 1 #

Patch Set 2 : diff -r c344ec9f4318 https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 3 : diff -r c344ec9f4318 https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 4 : diff -r c344ec9f4318 https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 5 : diff -r 1b7c5daffdff https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 6 : diff -r 1b7c5daffdff https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 7 : diff -r 0dee786a73f7 https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 8 : diff -r 0dee786a73f7 https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 9 : diff -r 54a5513d9d6a https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 10 : diff -r 54a5513d9d6a https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 11 : diff -r 54a5513d9d6a https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 12 : diff -r 54a5513d9d6a https://khr%40golang.org@code.google.com/p/go/ #

Total comments: 3

Patch Set 13 : diff -r 94165b19719e https://code.google.com/p/go/ #

Total comments: 4

Patch Set 14 : diff -r 8eba3dcd8ee0 https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 15 : diff -r 8eba3dcd8ee0 https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 16 : diff -r 8eba3dcd8ee0 https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 17 : diff -r 8eba3dcd8ee0 https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 18 : diff -r 8eba3dcd8ee0 https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 19 : diff -r 1272c318297f https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 20 : diff -r 20f12ba1f1fb https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 21 : diff -r 20f12ba1f1fb https://khr%40golang.org@code.google.com/p/go/ #

Total comments: 1

Patch Set 22 : diff -r 6efc914b865e https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 23 : diff -r 6efc914b865e https://khr%40golang.org@code.google.com/p/go/ #

Total comments: 3

Patch Set 24 : diff -r b7298e3e7773 https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 25 : diff -r b7298e3e7773 https://khr%40golang.org@code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+382 lines, -286 lines) Patch
M src/pkg/runtime/gc_test.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +70 lines, -0 lines 0 comments Download
M src/pkg/runtime/malloc.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 10 chunks +18 lines, -16 lines 0 comments Download
M src/pkg/runtime/malloc.goc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 14 chunks +84 lines, -143 lines 0 comments Download
M src/pkg/runtime/mcache.c View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +87 lines, -37 lines 0 comments Download
M src/pkg/runtime/mcentral.c View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 7 chunks +102 lines, -43 lines 0 comments Download
M src/pkg/runtime/mgc0.c View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 6 chunks +19 lines, -43 lines 0 comments Download
M src/pkg/runtime/mheap.c View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2 chunks +2 lines, -0 lines 0 comments Download
M src/pkg/runtime/runtime.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +0 lines, -4 lines 0 comments Download

Messages

Total messages: 19
khr
Hello dvyukov@google.com (cc: golang-codereviews@googlegroups.com), I'd like you to review this change to https://khr%40golang.org@code.google.com/p/go/
12 years, 10 months ago (2014-01-25 00:17:07 UTC) #1
bradfitz
(Nothing important. Just reading.) https://codereview.appspot.com/46810043/diff/210001/src/pkg/runtime/gc_test.go File src/pkg/runtime/gc_test.go (right): https://codereview.appspot.com/46810043/diff/210001/src/pkg/runtime/gc_test.go#newcode155 src/pkg/runtime/gc_test.go:155: type NoPtr1 struct { these ...
12 years, 10 months ago (2014-01-25 06:00:33 UTC) #2
dvyukov
Nice! I like the idea of P-local spans.
12 years, 10 months ago (2014-01-27 12:15:51 UTC) #3
dvyukov
please wait for https://codereview.appspot.com/46430043/ otherwise I will never submit it https://codereview.appspot.com/46810043/diff/230001/src/pkg/runtime/gc_test.go File src/pkg/runtime/gc_test.go (right): https://codereview.appspot.com/46810043/diff/230001/src/pkg/runtime/gc_test.go#newcode155 ...
12 years, 10 months ago (2014-01-27 12:48:09 UTC) #4
dvyukov
move MCaches to next line in change description -- first line is summary
12 years, 10 months ago (2014-01-27 13:48:41 UTC) #5
khr1
On Fri, Jan 24, 2014 at 10:00 PM, <bradfitz@golang.org> wrote: > (Nothing important. Just reading.) ...
12 years, 10 months ago (2014-01-27 19:21:02 UTC) #6
khr1
On Mon, Jan 27, 2014 at 4:48 AM, <dvyukov@google.com> wrote: > please wait for https://codereview.appspot.com/46430043/ ...
12 years, 10 months ago (2014-01-27 19:21:09 UTC) #7
khr1
On Mon, Jan 27, 2014 at 5:48 AM, <dvyukov@google.com> wrote: > move MCaches to next ...
12 years, 10 months ago (2014-01-27 19:21:18 UTC) #8
khr
On 2014/01/27 19:21:18, khr1 wrote: > On Mon, Jan 27, 2014 at 5:48 AM, <mailto:dvyukov@google.com> ...
12 years, 10 months ago (2014-01-28 02:20:20 UTC) #9
rsc
LGTM dmitriy has submitted the CL this was waiting on.
12 years, 9 months ago (2014-02-12 18:44:17 UTC) #10
dvyukov
LGTM
12 years, 9 months ago (2014-02-16 08:52:05 UTC) #11
dvyukov
https://codereview.appspot.com/46810043/diff/390001/src/pkg/runtime/mcentral.c File src/pkg/runtime/mcentral.c (right): https://codereview.appspot.com/46810043/diff/390001/src/pkg/runtime/mcentral.c#newcode123 src/pkg/runtime/mcentral.c:123: MCentral_ReturnToHeap(c, s); say that it unlocks c
12 years, 9 months ago (2014-02-16 08:52:16 UTC) #12
khr1
Dmitry, could you take another look? I had to fix up some things to handle ...
12 years, 9 months ago (2014-02-25 20:54:35 UTC) #13
dvyukov
LGTM i need to say that the code is more complex than I would like ...
12 years, 9 months ago (2014-02-26 07:20:51 UTC) #14
dvyukov
please also test with: go test -race -short -cpu=4 std that's what i frequently forget ...
12 years, 9 months ago (2014-02-26 07:21:48 UTC) #15
khr
On 2014/02/26 07:20:51, dvyukov wrote: > LGTM > > i need to say that the ...
12 years, 9 months ago (2014-02-26 23:49:17 UTC) #16
khr
On 2014/02/26 07:21:48, dvyukov wrote: > please also test with: > go test -race -short ...
12 years, 9 months ago (2014-02-26 23:50:21 UTC) #17
khr
*** Submitted as https://code.google.com/p/go/source/detail?r=13f8dc6e750f *** runtime: get rid of the settype buffer and lock. MCaches ...
12 years, 9 months ago (2014-02-26 23:53:02 UTC) #18
gobot
12 years, 9 months ago (2014-02-27 00:06:45 UTC) #19
Message was sent while issue was closed.
This CL appears to have broken the windows-386-ec2 builder.
Sign in to reply to this message.

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