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

Issue 10136043: code review 10136043: runtime: refactor mallocgc (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 9 months ago by dvyukov
Modified:
11 years, 8 months ago
Reviewers:
khr, rsc
CC:
golang-dev, iant, ioe, rsc, dave_cheney.net, khr, bradfitz, r
Visibility:
Public.

Description

runtime: refactor mallocgc Make it accept type, combine flags. Several reasons for the change: 1. mallocgc and settype must be atomic wrt GC 2. settype is called from only one place now 3. it will help performance (eventually settype functionality must be combined with markallocated) 4. flags are easier to read now (no mallocgc(sz, 0, 1, 0) anymore)

Patch Set 1 #

Patch Set 2 : diff -r 4aa7943034c5 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 3 : diff -r 4aa7943034c5 https://dvyukov%40google.com@code.google.com/p/go/ #

Total comments: 1

Patch Set 4 : diff -r 52d53d0e177e https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 5 : diff -r 52d53d0e177e https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 6 : diff -r 52d53d0e177e https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 7 : diff -r 71375a634b9a https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 8 : diff -r 71375a634b9a https://dvyukov%40google.com@code.google.com/p/go/ #

Total comments: 2

Patch Set 9 : diff -r dc24634de6c5 https://dvyukov%40google.com@code.google.com/p/go/ #

Total comments: 4

Patch Set 10 : diff -r 654ca7de0282 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 11 : diff -r 654ca7de0282 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 12 : diff -r 654ca7de0282 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 13 : diff -r 654ca7de0282 https://dvyukov%40google.com@code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+62 lines, -119 lines) Patch
M src/pkg/runtime/chan.c View 1 2 3 1 chunk +1 line, -2 lines 0 comments Download
M src/pkg/runtime/hashmap.c View 1 2 3 4 5 6 7 8 9 8 chunks +9 lines, -17 lines 0 comments Download
M src/pkg/runtime/malloc.h View 1 2 3 4 5 6 7 8 9 3 chunks +6 lines, -5 lines 0 comments Download
M src/pkg/runtime/malloc.goc View 1 2 3 4 5 6 7 8 9 11 chunks +36 lines, -85 lines 0 comments Download
M src/pkg/runtime/mfinal.c View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -2 lines 0 comments Download
M src/pkg/runtime/mgc0.c View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/runtime/proc.c View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -2 lines 0 comments Download
M src/pkg/runtime/stack.c View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/runtime/string.goc View 1 2 3 4 5 6 7 8 9 4 chunks +4 lines, -4 lines 0 comments Download

Messages

Total messages: 24
dvyukov
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://dvyukov%40google.com@code.google.com/p/go/
11 years, 9 months ago (2013-06-09 17:08:58 UTC) #1
iant
https://codereview.appspot.com/10136043/diff/5001/src/pkg/runtime/malloc.goc File src/pkg/runtime/malloc.goc (right): https://codereview.appspot.com/10136043/diff/5001/src/pkg/runtime/malloc.goc#newcode769 src/pkg/runtime/malloc.goc:769: m->locks++; // disable preemption to not expose the memory ...
11 years, 9 months ago (2013-06-10 17:31:20 UTC) #2
dvyukov
On Mon, Jun 10, 2013 at 9:31 PM, <iant@golang.org> wrote: > > https://codereview.appspot.com/10136043/diff/5001/src/pkg/runtime/malloc.goc > File ...
11 years, 9 months ago (2013-06-10 17:38:29 UTC) #3
dvyukov
On 2013/06/10 17:38:29, dvyukov wrote: > On Mon, Jun 10, 2013 at 9:31 PM, <mailto:iant@golang.org> ...
11 years, 9 months ago (2013-06-11 11:32:09 UTC) #4
iant
On Tue, Jun 11, 2013 at 4:32 AM, <dvyukov@google.com> wrote: > > What do you ...
11 years, 9 months ago (2013-06-11 15:36:28 UTC) #5
dvyukov
On Tue, Jun 11, 2013 at 7:36 PM, Ian Lance Taylor <iant@golang.org> wrote: > On ...
11 years, 9 months ago (2013-06-12 11:39:46 UTC) #6
dvyukov
Hello golang-dev@googlegroups.com, iant@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 9 months ago (2013-06-14 20:24:47 UTC) #7
dvyukov
On 2013/06/11 15:36:28, iant wrote: > On Tue, Jun 11, 2013 at 4:32 AM, <mailto:dvyukov@google.com> ...
11 years, 9 months ago (2013-06-14 20:25:10 UTC) #8
ioe
small nit. https://codereview.appspot.com/10136043/diff/27001/src/pkg/runtime/malloc.goc File src/pkg/runtime/malloc.goc (right): https://codereview.appspot.com/10136043/diff/27001/src/pkg/runtime/malloc.goc#newcode30 src/pkg/runtime/malloc.goc:30: runtime·mallocgc(uintptr size, uintptr typ, uint32 flag) mallocgc() ...
11 years, 9 months ago (2013-06-14 22:57:26 UTC) #9
dvyukov
https://codereview.appspot.com/10136043/diff/27001/src/pkg/runtime/malloc.goc File src/pkg/runtime/malloc.goc (right): https://codereview.appspot.com/10136043/diff/27001/src/pkg/runtime/malloc.goc#newcode30 src/pkg/runtime/malloc.goc:30: runtime·mallocgc(uintptr size, uintptr typ, uint32 flag) On 2013/06/14 22:57:26, ...
11 years, 9 months ago (2013-06-15 11:58:41 UTC) #10
rsc
Merging the final two bools in mallogc into the flag seems fine to me.
11 years, 9 months ago (2013-07-02 00:38:02 UTC) #11
dave_cheney.net
A while back I was working on a CL that reduced the number of arguments ...
11 years, 9 months ago (2013-07-02 00:59:30 UTC) #12
dvyukov
ping
11 years, 8 months ago (2013-07-17 10:04:34 UTC) #13
khr
On 2013/07/17 10:04:34, dvyukov wrote: > ping LGTM
11 years, 8 months ago (2013-07-19 19:38:57 UTC) #14
rsc
NOT LGTM
11 years, 8 months ago (2013-07-19 19:58:01 UTC) #15
rsc
There is enough broken in the runtime. Please wait on this CL until other things ...
11 years, 8 months ago (2013-07-19 19:58:23 UTC) #16
bradfitz
https://codereview.appspot.com/10136043/diff/45001/src/pkg/runtime/malloc.h File src/pkg/runtime/malloc.h (right): https://codereview.appspot.com/10136043/diff/45001/src/pkg/runtime/malloc.h#newcode468 src/pkg/runtime/malloc.h:468: // flags to malloc // flags to mallocgc https://codereview.appspot.com/10136043/diff/45001/src/pkg/runtime/malloc.h#newcode472 ...
11 years, 8 months ago (2013-07-20 05:21:27 UTC) #17
r
If possible lease find a way the flag isn't negative true, or we end up ...
11 years, 8 months ago (2013-07-20 07:18:11 UTC) #18
dvyukov
On Sat, Jul 20, 2013 at 11:17 AM, Rob Pike <r@golang.org> wrote: > If possible ...
11 years, 8 months ago (2013-07-20 10:56:10 UTC) #19
dvyukov
On Sat, Jul 20, 2013 at 9:21 AM, <bradfitz@golang.org> wrote: > > https://codereview.appspot.com/10136043/diff/45001/src/pkg/runtime/malloc.h > File ...
11 years, 8 months ago (2013-07-20 10:57:16 UTC) #20
r
FlagNoZero is fine in this case then. I was just expressing a common problem with ...
11 years, 8 months ago (2013-07-20 21:25:46 UTC) #21
rsc
LGTM You buried the lede in the CL description. I would not have kept pushing ...
11 years, 8 months ago (2013-07-22 18:52:36 UTC) #22
rsc
LGTM after flag name change
11 years, 8 months ago (2013-07-22 18:52:46 UTC) #23
dvyukov
11 years, 8 months ago (2013-07-26 17:17:35 UTC) #24
*** Submitted as https://code.google.com/p/go/source/detail?r=9d89d3ed8922 ***

runtime: refactor mallocgc
Make it accept type, combine flags.
Several reasons for the change:
1. mallocgc and settype must be atomic wrt GC
2. settype is called from only one place now
3. it will help performance (eventually settype
functionality must be combined with markallocated)
4. flags are easier to read now (no mallocgc(sz, 0, 1, 0) anymore)

R=golang-dev, iant, nightlyone, rsc, dave, khr, bradfitz, r
CC=golang-dev
https://codereview.appspot.com/10136043
Sign in to reply to this message.

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