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

Issue 9716045: code review 9716045: runtime: simplify runtime·settype() (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 11 months ago by atom
Modified:
10 years, 11 months ago
CC:
golang-dev, rsc
Visibility:
Public.

Description

runtime: simplify runtime·settype() This changeset removes buffering of type information and removes support for SysAlloc from the code.

Patch Set 1 #

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

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

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

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

Total comments: 2

Patch Set 6 : diff -r 8c800027d5a6 https://code.google.com/p/go/ #

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

Total comments: 2

Patch Set 8 : diff -r 1faca3687fe6 https://code.google.com/p/go/ #

Patch Set 9 : diff -r 1faca3687fe6 https://code.google.com/p/go/ #

Patch Set 10 : diff -r e86ab7e59e50 https://code.google.com/p/go/ #

Total comments: 11

Patch Set 11 : diff -r 1f7fdf4ad92d https://code.google.com/p/go/ #

Total comments: 10

Patch Set 12 : diff -r baa90b763ecd https://code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+63 lines, -222 lines) Patch
M src/pkg/runtime/malloc.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +8 lines, -16 lines 0 comments Download
M src/pkg/runtime/malloc.goc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +45 lines, -177 lines 0 comments Download
M src/pkg/runtime/mgc0.c View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +5 lines, -21 lines 0 comments Download
M src/pkg/runtime/mheap.c View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +5 lines, -5 lines 0 comments Download
M src/pkg/runtime/runtime.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -3 lines 0 comments Download

Messages

Total messages: 35
atom
Hello golang-dev@googlegroups.com (cc: dvyukov@google.com, rsc@golang.org), I'd like you to review this change to https://code.google.com/p/go/
10 years, 11 months ago (2013-05-30 14:24:15 UTC) #1
khr
https://codereview.appspot.com/9716045/diff/1007/src/pkg/runtime/malloc.goc File src/pkg/runtime/malloc.goc (right): https://codereview.appspot.com/9716045/diff/1007/src/pkg/runtime/malloc.goc#newcode572 src/pkg/runtime/malloc.goc:572: data2 = runtime·mallocgc(nbytes2, FlagNoProfiling|FlagNoPointers, 0, 1); Don't call malloc ...
10 years, 11 months ago (2013-05-30 17:34:02 UTC) #2
atom
https://codereview.appspot.com/9716045/diff/1007/src/pkg/runtime/malloc.goc File src/pkg/runtime/malloc.goc (right): https://codereview.appspot.com/9716045/diff/1007/src/pkg/runtime/malloc.goc#newcode572 src/pkg/runtime/malloc.goc:572: data2 = runtime·mallocgc(nbytes2, FlagNoProfiling|FlagNoPointers, 0, 1); On 2013/05/30 17:34:03, ...
10 years, 11 months ago (2013-05-30 18:25:54 UTC) #3
khr1
I did not see that, sorry. I'm still concerned about the spin lock, though, if ...
10 years, 11 months ago (2013-05-30 19:39:44 UTC) #4
atom
Hello golang-dev@googlegroups.com, khr@golang.org, khr@google.com (cc: dvyukov@google.com, golang-dev@googlegroups.com, rsc@golang.org), Please take another look.
10 years, 11 months ago (2013-05-30 19:52:31 UTC) #5
khr1
LGTM. Have Dmitry or Carl take a look also. On Thu, May 30, 2013 at ...
10 years, 11 months ago (2013-05-30 20:03:22 UTC) #6
cshapiro1
LGTM What, if any, is the performance consequence of this change? https://codereview.appspot.com/9716045/diff/18006/src/pkg/runtime/malloc.goc File src/pkg/runtime/malloc.goc (right): ...
10 years, 11 months ago (2013-05-30 21:59:07 UTC) #7
atom
https://codereview.appspot.com/9716045/diff/18006/src/pkg/runtime/malloc.goc File src/pkg/runtime/malloc.goc (right): https://codereview.appspot.com/9716045/diff/18006/src/pkg/runtime/malloc.goc#newcode509 src/pkg/runtime/malloc.goc:509: uintptr ntypes, nbytes2, nbytes3; On 2013/05/30 21:59:08, cshapiro1 wrote: ...
10 years, 11 months ago (2013-05-31 05:26:23 UTC) #8
dvyukov
The "remove sysalloc" part looks good. But the "remove caching" NOT LGTM. There is already ...
10 years, 11 months ago (2013-05-31 06:33:07 UTC) #9
atom
Patchset 5 has runtime·lock() inlined into runtime·settype(). Could you please rerun the benchmark with patchset ...
10 years, 11 months ago (2013-05-31 06:40:27 UTC) #10
atom
I expect the spinlock variable to be zero on entry to settype() in majority of ...
10 years, 11 months ago (2013-05-31 06:51:09 UTC) #11
dvyukov
On 2013/05/31 06:40:27, atom wrote: > Patchset 5 has runtime·lock() inlined into runtime·settype(). Could you ...
10 years, 11 months ago (2013-05-31 07:17:01 UTC) #12
atom
I uploaded a new patchset. Please rerun the benchmark.
10 years, 11 months ago (2013-05-31 08:12:13 UTC) #13
atom
I updated the settype function and fixed the irrational code introduced in the previous changeset. ...
10 years, 11 months ago (2013-05-31 18:38:19 UTC) #14
iant
https://codereview.appspot.com/9716045/diff/35001/src/pkg/runtime/malloc.goc File src/pkg/runtime/malloc.goc (right): https://codereview.appspot.com/9716045/diff/35001/src/pkg/runtime/malloc.goc#newcode564 src/pkg/runtime/malloc.goc:564: if(DebugTypeAtBlockEnd) { This seems unrelated to this CL. https://codereview.appspot.com/9716045/diff/35001/src/pkg/runtime/malloc.goc#newcode577 ...
10 years, 11 months ago (2013-05-31 19:04:17 UTC) #15
atom
https://codereview.appspot.com/9716045/diff/35001/src/pkg/runtime/malloc.goc File src/pkg/runtime/malloc.goc (right): https://codereview.appspot.com/9716045/diff/35001/src/pkg/runtime/malloc.goc#newcode577 src/pkg/runtime/malloc.goc:577: switch(s->types.compression) { On 2013/05/31 19:04:17, iant wrote: > This ...
10 years, 11 months ago (2013-05-31 19:33:11 UTC) #16
atom
https://codereview.appspot.com/9716045/diff/35001/src/pkg/runtime/malloc.goc File src/pkg/runtime/malloc.goc (right): https://codereview.appspot.com/9716045/diff/35001/src/pkg/runtime/malloc.goc#newcode564 src/pkg/runtime/malloc.goc:564: if(DebugTypeAtBlockEnd) { On 2013/05/31 19:04:17, iant wrote: > This ...
10 years, 11 months ago (2013-06-01 16:33:45 UTC) #17
dvyukov
https://codereview.appspot.com/9716045/diff/41001/src/pkg/runtime/malloc.goc File src/pkg/runtime/malloc.goc (right): https://codereview.appspot.com/9716045/diff/41001/src/pkg/runtime/malloc.goc#newcode560 src/pkg/runtime/malloc.goc:560: // The suffix 3 (nbytes3, data3) means that the ...
10 years, 11 months ago (2013-06-03 07:30:52 UTC) #18
dvyukov
https://codereview.appspot.com/9716045/diff/41001/src/pkg/runtime/malloc.goc File src/pkg/runtime/malloc.goc (right): https://codereview.appspot.com/9716045/diff/41001/src/pkg/runtime/malloc.goc#newcode687 src/pkg/runtime/malloc.goc:687: // The probability of the race condition is extremely ...
10 years, 11 months ago (2013-06-03 08:23:34 UTC) #19
dvyukov
Now it's quite debatable whether it's a simplification as the change description says. I've remeasured ...
10 years, 11 months ago (2013-06-03 09:04:17 UTC) #20
atom
Considering what's been written in discussion "Better GC and Memory Allocator" (https://groups.google.com/forum/?fromgroups#!topic/golang-dev/pwUh0BVFpY0) and taking into ...
10 years, 11 months ago (2013-06-03 12:21:51 UTC) #21
dvyukov
On 2013/06/03 12:21:51, atom wrote: > Considering what's been written in discussion "Better GC and ...
10 years, 11 months ago (2013-06-03 12:29:17 UTC) #22
atom
On 2013/06/03 12:29:17, dvyukov wrote: > On 2013/06/03 12:21:51, atom wrote: > > Considering what's ...
10 years, 11 months ago (2013-06-03 13:11:39 UTC) #23
dvyukov
On 2013/06/03 13:11:39, atom wrote: > On 2013/06/03 12:29:17, dvyukov wrote: > > On 2013/06/03 ...
10 years, 11 months ago (2013-06-03 13:23:43 UTC) #24
atom
On 2013/06/03 13:23:43, dvyukov wrote: > Please also measure memory consumption on linux/amd64. You can ...
10 years, 11 months ago (2013-06-03 13:28:56 UTC) #25
atom
On 2013/06/03 13:28:56, atom wrote: > On 2013/06/03 13:23:43, dvyukov wrote: > > Please also ...
10 years, 11 months ago (2013-06-03 14:11:03 UTC) #26
dvyukov
So your benchmarks show 2.22% speedup and 2.86% memory increase. On linux/am64 I see 2.19% ...
10 years, 11 months ago (2013-06-03 14:55:26 UTC) #27
atom
On 2013/06/03 14:55:26, dvyukov wrote: > So your benchmarks show 2.22% speedup and 2.86% memory ...
10 years, 11 months ago (2013-06-03 15:25:28 UTC) #28
atom
On 2013/06/03 14:55:26, dvyukov wrote: > So your benchmarks show 2.22% speedup and 2.86% memory ...
10 years, 11 months ago (2013-06-05 10:11:30 UTC) #29
dvyukov
On 2013/06/05 10:11:30, atom wrote: > On 2013/06/03 14:55:26, dvyukov wrote: > > So your ...
10 years, 11 months ago (2013-06-05 11:50:05 UTC) #30
atom
On 2013/06/05 11:50:05, dvyukov wrote: > On 2013/06/05 10:11:30, atom wrote: > > I have ...
10 years, 11 months ago (2013-06-05 12:29:37 UTC) #31
dvyukov
On Wed, Jun 5, 2013 at 4:29 PM, <0xE2.0x9A.0x9B@gmail.com> wrote: > On 2013/06/05 11:50:05, dvyukov ...
10 years, 11 months ago (2013-06-05 13:03:01 UTC) #32
atom
On 2013/06/05 13:03:01, dvyukov wrote: > On Wed, Jun 5, 2013 at 4:29 PM, <mailto:0xE2.0x9A.0x9B@gmail.com> ...
10 years, 11 months ago (2013-06-05 13:29:51 UTC) #33
dvyukov
On Wed, Jun 5, 2013 at 5:29 PM, <0xE2.0x9A.0x9B@gmail.com> wrote: > On 2013/06/05 13:03:01, dvyukov ...
10 years, 11 months ago (2013-06-05 13:36:49 UTC) #34
atom
10 years, 11 months ago (2013-06-05 14:40:35 UTC) #35
On 2013/06/05 13:36:49, dvyukov wrote:
> On Wed, Jun 5, 2013 at 5:29 PM,  <mailto:0xE2.0x9A.0x9B@gmail.com> wrote:
> > The typical size of a memory block holding typeinfos is about 1024
> > bytes. The list of memory allocation requests for the parser benchmark
> > looks as follows (size in bytes, 32-bit platform):
> >
> > ... 2048 512 1024 512 2048 1024 344 512 144 168 256 128 1024 344 512
> > 2048 1024 256 512 1024 512 2048 1024 32 512 1024 512 1024 2048 512 1024
> > 344 512 2048 1024 16 512 1024 512 344 2048 1024 512 512 1024 2048 512 64
> > 1024 344 512 2048 1024 512 256 1024 2048 512 16 512 1024 2048 512 1024
> > 512 1024 2048 88 1024 8 8 ...
> >
> > A span is aligned to a page size, which is 4096 bytes. Embedding the
> > type table directly into span itself would mean that the above numbers
> > have to be rounded to a multiple of 4096.
> 
> What they have to be rounded to 4096?
> A single 4096-byte span can hold lots of 8-byte allocations and the
> associated type info, no rounding is required.

I don't have enough vitality. I am closing this CL.
Sign in to reply to this message.

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