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

Issue 112240044: code review 112240044: undo CL 101570044 / 2c57aaea79c4 (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 9 months ago by khr
Modified:
9 years, 9 months ago
Reviewers:
dvyukov
CC:
dvyukov, dave_cheney.net, khr1, brainman, golang-codereviews
Visibility:
Public.

Description

undo CL 101570044 / 2c57aaea79c4 redo stack allocation. This is mostly the same as the original CL with a few bug fixes. 1. add racemalloc() for stack allocations 2. fix poolalloc/poolfree to terminate free lists correctly. 3. adjust span ref count correctly. 4. don't use cache for sizes >= StackCacheSize. Should fix bugs and memory leaks in original changelist. ««« original CL description undo CL 104200047 / 318b04f28372 Breaks windows and race detector. TBR=rsc ««« original CL description runtime: stack allocator, separate from mallocgc In order to move malloc to Go, we need to have a separate stack allocator. If we run out of stack during malloc, malloc will not be available to allocate a new stack. Stacks are the last remaining FlagNoGC objects in the GC heap. Once they are out, we can get rid of the distinction between the allocated/blockboundary bits. (This will be in a separate change.) Fixes issue 7468 Fixes issue 7424 LGTM=rsc, dvyukov R=golang-codereviews, dvyukov, khr, dave, rsc CC=golang-codereviews https://codereview.appspot.com/104200047 »»» TBR=rsc CC=golang-codereviews https://codereview.appspot.com/101570044 »»»

Patch Set 1 #

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

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

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

Total comments: 3

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

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

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+552 lines, -301 lines) Patch
M src/pkg/runtime/malloc.h View 1 8 chunks +23 lines, -4 lines 0 comments Download
M src/pkg/runtime/mcache.c View 1 2 3 4 5 1 chunk +21 lines, -2 lines 0 comments Download
M src/pkg/runtime/mcentral.c View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/runtime/mem.go View 1 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/runtime/mgc0.c View 1 2 3 4 5 chunks +18 lines, -7 lines 0 comments Download
M src/pkg/runtime/mheap.c View 1 15 chunks +189 lines, -138 lines 0 comments Download
M src/pkg/runtime/proc.c View 1 2 3 4 5 6 3 chunks +5 lines, -1 line 0 comments Download
M src/pkg/runtime/runtime.h View 1 5 chunks +3 lines, -12 lines 0 comments Download
M src/pkg/runtime/stack.c View 1 2 3 4 5 13 chunks +241 lines, -136 lines 0 comments Download
M src/pkg/runtime/stack_test.go View 1 1 chunk +49 lines, -0 lines 0 comments Download

Messages

Total messages: 11
khr
Hello dvyukov (cc: golang-codereviews@googlegroups.com), I'd like you to review this change to https://khr%40golang.org@code.google.com/p/go/
9 years, 9 months ago (2014-07-17 03:57:19 UTC) #1
dave_cheney.net
Is this an undo of an undo ? On Thu, Jul 17, 2014 at 1:57 ...
9 years, 9 months ago (2014-07-17 03:59:14 UTC) #2
khr1
Yes, it is. Plus bug fixes. On Wed, Jul 16, 2014 at 8:59 PM, Dave ...
9 years, 9 months ago (2014-07-17 04:09:39 UTC) #3
dvyukov
On 2014/07/17 03:59:14, dfc wrote: > Is this an undo of an undo ? I ...
9 years, 9 months ago (2014-07-17 04:41:37 UTC) #4
brainman
All tests pass on both windows/386 and windows/amd64. Alex
9 years, 9 months ago (2014-07-17 06:43:58 UTC) #5
dave_cheney.net
On 2014/07/17 06:43:58, brainman wrote: > All tests pass on both windows/386 and windows/amd64. > ...
9 years, 9 months ago (2014-07-17 08:21:58 UTC) #6
dave_cheney.net
linux/arm is fine as well. On Thu, Jul 17, 2014 at 6:21 PM, <dave@cheney.net> wrote: ...
9 years, 9 months ago (2014-07-17 09:51:32 UTC) #7
dvyukov
LGTM with nits https://codereview.appspot.com/112240044/diff/60001/src/pkg/runtime/stack.c File src/pkg/runtime/stack.c (right): https://codereview.appspot.com/112240044/diff/60001/src/pkg/runtime/stack.c#newcode242 src/pkg/runtime/stack.c:242: s = runtime·MHeap_AllocStack(&runtime·mheap, (n+PageSize-1) >> PageShift); ...
9 years, 9 months ago (2014-07-17 16:43:49 UTC) #8
khr
*** Submitted as https://code.google.com/p/go/source/detail?r=bac0a67b0b70 *** undo CL 101570044 / 2c57aaea79c4 redo stack allocation. This is ...
9 years, 9 months ago (2014-07-17 21:41:59 UTC) #9
dvyukov
Perf dashboard reports 7036874417757228.00% increase in stack usage: http://goperfd.appspot.com/perfdetail?commit=a622a4ff09da1ca11880d1b58fc122ac13f9e09a&commit0=b1edf8faa5d6cbc50c6515785df9df9c19296564&builder=linux-amd64&benchmark=json On Fri, Jul 18, 2014 at ...
9 years, 9 months ago (2014-07-18 10:22:19 UTC) #10
khr1
9 years, 9 months ago (2014-07-18 22:59:31 UTC) #11
Fix at https://codereview.appspot.com/112450045/


On Fri, Jul 18, 2014 at 3:21 AM, Dmitry Vyukov <dvyukov@google.com> wrote:

> Perf dashboard reports 7036874417757228.00% increase in stack usage:
>
>
http://goperfd.appspot.com/perfdetail?commit=a622a4ff09da1ca11880d1b58fc122ac...
>
>
>
>
> On Fri, Jul 18, 2014 at 1:41 AM,  <khr@golang.org> wrote:
> > *** Submitted as
> > https://code.google.com/p/go/source/detail?r=bac0a67b0b70 ***
> >
> >
> > undo CL 101570044 / 2c57aaea79c4
> >
> > redo stack allocation.  This is mostly the same as
> > the original CL with a few bug fixes.
> >
> > 1. add racemalloc() for stack allocations
> > 2. fix poolalloc/poolfree to terminate free lists correctly.
> > 3. adjust span ref count correctly.
> > 4. don't use cache for sizes >= StackCacheSize.
> >
> > Should fix bugs and memory leaks in original changelist.
> >
> > ««« original CL description
> > undo CL 104200047 / 318b04f28372
> >
> > Breaks windows and race detector.
> > TBR=rsc
> >
> > ««« original CL description
> > runtime: stack allocator, separate from mallocgc
> >
> > In order to move malloc to Go, we need to have a
> > separate stack allocator.  If we run out of stack
> > during malloc, malloc will not be available
> > to allocate a new stack.
> >
> > Stacks are the last remaining FlagNoGC objects in the
> > GC heap.  Once they are out, we can get rid of the
> > distinction between the allocated/blockboundary bits.
> > (This will be in a separate change.)
> >
> > Fixes issue 7468
> > Fixes issue 7424
> >
> > LGTM=rsc, dvyukov
> > R=golang-codereviews, dvyukov, khr, dave, rsc
> > CC=golang-codereviews
> > https://codereview.appspot.com/104200047
> > »»»
> >
> > TBR=rsc
> > CC=golang-codereviews
> > https://codereview.appspot.com/101570044
> > »»»
> >
> > LGTM=dvyukov
> > R=dvyukov, dave, khr, alex.brainman
> > CC=golang-codereviews
> > https://codereview.appspot.com/112240044
> >
> >
> > https://codereview.appspot.com/112240044/
>
Sign in to reply to this message.

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