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

Issue 75960043: code review 75960043: runtime: fix yet another race in bgsweep (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:
gobot, rsc
CC:
rsc, golang-codereviews
Visibility:
Public.

Description

runtime: fix yet another race in bgsweep Currently it's possible that bgsweep finishes before all spans have been swept (we only know that sweeping of all spans has *started*). In such case bgsweep may fail wake up runfinq goroutine when it needs to. finq may still be nil at this point, but some finalizers may be queued later. Make bgsweep to wait for sweeping to *complete*, then it can decide whether it needs to wake up runfinq for sure. Update issue 7533

Patch Set 1 #

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

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

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

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

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

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

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

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

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

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

Total comments: 4

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

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

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+47 lines, -35 lines) Patch
M src/pkg/runtime/malloc.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +4 lines, -0 lines 0 comments Download
M src/pkg/runtime/malloc.goc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download
M src/pkg/runtime/mgc0.c View 1 2 3 4 5 6 7 8 9 10 11 12 13 10 chunks +40 lines, -35 lines 0 comments Download
M src/pkg/runtime/proc.c View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 13
dvyukov
Hello rsc@golang.org (cc: golang-codereviews@googlegroups.com), 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-14 09:14:35 UTC) #1
dvyukov
This is somewhat uglier than I would like to. One constraint on the fix is ...
10 years, 1 month ago (2014-03-14 09:19:33 UTC) #2
rsc
Can we create the finq goroutine during the first call to runtime.SetFinalizer? Then runfing would ...
10 years, 1 month ago (2014-03-14 18:24:32 UTC) #3
dvyukov
On 2014/03/14 18:24:32, rsc wrote: > Can we create the finq goroutine during the first ...
10 years, 1 month ago (2014-03-17 11:06:19 UTC) #4
dvyukov
On 2014/03/17 11:06:19, dvyukov wrote: > On 2014/03/14 18:24:32, rsc wrote: > > Can we ...
10 years, 1 month ago (2014-03-17 11:08:20 UTC) #5
dvyukov
On 2014/03/17 11:08:20, dvyukov wrote: > On 2014/03/17 11:06:19, dvyukov wrote: > > On 2014/03/14 ...
10 years, 1 month ago (2014-03-17 12:41:10 UTC) #6
rsc
I think this is pretty clean. https://codereview.appspot.com/75960043/diff/180005/src/pkg/runtime/mgc0.c File src/pkg/runtime/mgc0.c (right): https://codereview.appspot.com/75960043/diff/180005/src/pkg/runtime/mgc0.c#newcode2613 src/pkg/runtime/mgc0.c:2613: runtime·lock(&gclock); Can this ...
10 years, 1 month ago (2014-03-24 19:04:00 UTC) #7
dvyukov
PTAL https://codereview.appspot.com/75960043/diff/180005/src/pkg/runtime/mgc0.c File src/pkg/runtime/mgc0.c (right): https://codereview.appspot.com/75960043/diff/180005/src/pkg/runtime/mgc0.c#newcode2613 src/pkg/runtime/mgc0.c:2613: runtime·lock(&gclock); On 2014/03/24 19:04:00, rsc wrote: > Can ...
10 years, 1 month ago (2014-03-25 20:12:04 UTC) #8
dvyukov
It does not fix sync.Pool finalizer test. There must be something else.
10 years, 1 month ago (2014-03-25 20:12:39 UTC) #9
rsc
LGTM Please submit even though it doesn't completely fix the problem. Sometimes the problem is ...
10 years, 1 month ago (2014-03-25 21:01:10 UTC) #10
dvyukov
On 2014/03/25 21:01:10, rsc wrote: > LGTM > > Please submit even though it doesn't ...
10 years, 1 month ago (2014-03-26 11:06:39 UTC) #11
dvyukov
*** Submitted as https://code.google.com/p/go/source/detail?r=725e6ae0d712 *** runtime: fix yet another race in bgsweep Currently it's possible ...
10 years, 1 month ago (2014-03-26 11:11:45 UTC) #12
gobot
10 years, 1 month ago (2014-03-26 12:34:39 UTC) #13
Message was sent while issue was closed.
This CL appears to have broken the plan9-386-cnielsen builder.
See http://build.golang.org/log/933738562c735ee5877ac5b908cc0fe7a5a80fe7
Sign in to reply to this message.

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