diff options
author | Simon Marlow <smarlow@fb.com> | 2016-10-28 08:30:14 -0700 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2016-10-29 19:33:52 +0100 |
commit | 4e088b497edd83f361898fa9d2d62ff310b08945 (patch) | |
tree | f0ef3a8f2443cec7dcdce15493fd8ad92e197997 /rts/sm/GC.h | |
parent | 4b300a32257c3ed272747f7e75709a26dd2d8407 (diff) | |
download | haskell-4e088b497edd83f361898fa9d2d62ff310b08945.tar.gz |
Fix a bug in parallel GC synchronisation
Summary:
The problem boils down to global variables: in particular gc_threads[],
which was being modified by a subsequent GC before the previous GC had
finished with it. The fix is to not use global variables.
This was causing setnumcapabilities001 to fail (again!). It's an old
bug though.
Test Plan:
Ran setnumcapabilities001 in a loop for a couple of hours. Before this
patch it had been failing after a few minutes. Not a very scientific
test, but it's the best I have.
Reviewers: bgamari, austin, fryguybob, niteria, erikd
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2654
Diffstat (limited to 'rts/sm/GC.h')
-rw-r--r-- | rts/sm/GC.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/rts/sm/GC.h b/rts/sm/GC.h index c32064a4dd..707d4b52d6 100644 --- a/rts/sm/GC.h +++ b/rts/sm/GC.h @@ -6,7 +6,7 @@ * * Documentation on the architecture of the Garbage Collector can be * found in the online commentary: - * + * * http://ghc.haskell.org/trac/ghc/wiki/Commentary/Rts/Storage/GC * * ---------------------------------------------------------------------------*/ @@ -20,7 +20,7 @@ void GarbageCollect (rtsBool force_major_gc, rtsBool do_heap_census, - uint32_t gc_type, Capability *cap); + uint32_t gc_type, Capability *cap, rtsBool idle_cap[]); typedef void (*evac_fn)(void *user, StgClosure **root); @@ -55,8 +55,8 @@ void initGcThreads (uint32_t from, uint32_t to); void freeGcThreads (void); #if defined(THREADED_RTS) -void waitForGcThreads (Capability *cap); -void releaseGCThreads (Capability *cap); +void waitForGcThreads (Capability *cap, rtsBool idle_cap[]); +void releaseGCThreads (Capability *cap, rtsBool idle_cap[]); #endif #define WORK_UNIT_WORDS 128 |