summaryrefslogtreecommitdiff
path: root/rts/sm/GCThread.h
diff options
context:
space:
mode:
authorSimon Marlow <smarlow@fb.com>2016-10-28 08:30:14 -0700
committerSimon Marlow <marlowsd@gmail.com>2016-10-29 19:33:52 +0100
commit4e088b497edd83f361898fa9d2d62ff310b08945 (patch)
treef0ef3a8f2443cec7dcdce15493fd8ad92e197997 /rts/sm/GCThread.h
parent4b300a32257c3ed272747f7e75709a26dd2d8407 (diff)
downloadhaskell-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/GCThread.h')
-rw-r--r--rts/sm/GCThread.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/rts/sm/GCThread.h b/rts/sm/GCThread.h
index b728315554..f940263665 100644
--- a/rts/sm/GCThread.h
+++ b/rts/sm/GCThread.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
*
* ---------------------------------------------------------------------------*/
@@ -21,7 +21,7 @@
/* -----------------------------------------------------------------------------
General scheme
-
+
ToDo: move this to the wiki when the implementation is done.
We're only going to try to parallelise the copying GC for now. The
@@ -67,13 +67,13 @@
/* -----------------------------------------------------------------------------
Generation Workspace
-
+
A generation workspace exists for each generation for each GC
thread. The GC thread takes a block from the todos list of the
generation into the scanbd and then scans it. Objects referred to
by those in the scan block are copied into the todo or scavd blocks
of the relevant generation.
-
+
------------------------------------------------------------------------- */
typedef struct gen_workspace_ {
@@ -127,7 +127,6 @@ typedef struct gc_thread_ {
volatile StgWord wakeup; // NB not StgWord8; only StgWord is guaranteed atomic
#endif
uint32_t thread_index; // a zero based index identifying the thread
- rtsBool idle; // sitting out of this GC cycle
bdescr * free_blocks; // a buffer of free blocks for this thread
// during GC without accessing the block
@@ -211,4 +210,3 @@ extern ThreadLocalKey gctKey;
#include "EndPrivate.h"
#endif // SM_GCTHREAD_H
-