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

Issue 72440043: code review 72440043: runtime: refactor and fix stack management code (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 1 month ago by dvyukov
Modified:
10 years, 1 month ago
Reviewers:
khr, rsc
CC:
golang-codereviews, rsc, khr
Visibility:
Public.

Description

runtime: refactor and fix stack management code There are at least 3 bugs: 1. g->stacksize accounting is broken during copystack/shrinkstack 2. stktop->free is not properly maintained during copystack/shrinkstack 3. stktop->free logic is broken: we can have stktop->free==FixedStack, and we will free it into stack cache, but it actually comes from heap as the result of non-copying segment shrink This shows as at least spurious races on race builders (maybe something else as well I don't know). The idea behind the refactoring is to consolidate stacksize and segment origin logic in stackalloc/stackfree. Fixes issue 7490.

Patch Set 1 #

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

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

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

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

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

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+69 lines, -49 lines) Patch
M src/pkg/runtime/panic.c View 1 2 3 4 5 6 1 chunk +1 line, -4 lines 0 comments Download
M src/pkg/runtime/proc.c View 1 2 3 4 chunks +22 lines, -12 lines 0 comments Download
M src/pkg/runtime/runtime.h View 1 2 3 4 5 6 2 chunks +3 lines, -3 lines 0 comments Download
M src/pkg/runtime/stack.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/runtime/stack.c View 1 2 3 4 14 chunks +42 lines, -29 lines 0 comments Download

Messages

Total messages: 5
dvyukov
Hello golang-codereviews@googlegroups.com (cc: khr@golang.org, rsc@golang.org), I'd like you to review this change to https://dvyukov%40google.com@code.google.com/p/go/
10 years, 1 month ago (2014-03-07 11:40:15 UTC) #1
rsc
LGTM Does this fix the race builders?
10 years, 1 month ago (2014-03-07 16:42:00 UTC) #2
khr
On 2014/03/07 16:42:00, rsc wrote: > LGTM > > Does this fix the race builders? ...
10 years, 1 month ago (2014-03-07 16:43:58 UTC) #3
dvyukov
yes On Fri, Mar 7, 2014 at 8:42 PM, <rsc@golang.org> wrote: > LGTM > > ...
10 years, 1 month ago (2014-03-07 16:44:47 UTC) #4
dvyukov
10 years, 1 month ago (2014-03-07 16:52:38 UTC) #5
*** Submitted as https://code.google.com/p/go/source/detail?r=77d8d214820e ***

runtime: refactor and fix stack management code
There are at least 3 bugs:
1. g->stacksize accounting is broken during copystack/shrinkstack
2. stktop->free is not properly maintained during copystack/shrinkstack
3. stktop->free logic is broken:
        we can have stktop->free==FixedStack,
        and we will free it into stack cache,
        but it actually comes from heap as the result of non-copying segment
shrink
This shows as at least spurious races on race builders (maybe something else as
well I don't know).

The idea behind the refactoring is to consolidate stacksize and
segment origin logic in stackalloc/stackfree.

Fixes issue 7490.

LGTM=rsc, khr
R=golang-codereviews, rsc, khr
CC=golang-codereviews
https://codereview.appspot.com/72440043
Sign in to reply to this message.

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