summaryrefslogtreecommitdiff
path: root/rts/sm
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2017-07-17 17:32:44 +0100
committerSimon Marlow <marlowsd@gmail.com>2017-07-18 12:45:47 +0100
commit12ae1fa51b2f59e37d6100359b494bee2192ef0a (patch)
treed5c24f6ac1eac5f8252f4dd369a80706b7f86119 /rts/sm
parentf656fba19d0cefe05643ddea35d080ea332a6584 (diff)
downloadhaskell-12ae1fa51b2f59e37d6100359b494bee2192ef0a.tar.gz
Fix a missing getNewNursery(), and related cleanup
Summary: When we use nursery chunks with +RTS -n<size>, when the current nursery runs out we have to check whether there's another chunk available with getNewNursery(). There was one place we weren't doing this: the ad-hoc heap check in scheduleProcessInbox(). The impact of the bug was that we would GC too early when using nursery chunks, especially in programs that used messages (throwTo between capabilities could do this, also hs_try_putmvar()). Test Plan: validate, also local testing in our application Reviewers: bgamari, niteria, austin, erikd Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3749
Diffstat (limited to 'rts/sm')
-rw-r--r--rts/sm/Storage.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/rts/sm/Storage.h b/rts/sm/Storage.h
index 2d69eeed74..aaa44428b3 100644
--- a/rts/sm/Storage.h
+++ b/rts/sm/Storage.h
@@ -25,17 +25,6 @@ void freeStorage(bool free_heap);
void storageAddCapabilities (uint32_t from, uint32_t to);
/* -----------------------------------------------------------------------------
- Should we GC?
- -------------------------------------------------------------------------- */
-
-INLINE_HEADER
-bool doYouWantToGC(Capability *cap)
-{
- return (cap->r.rCurrentNursery->link == NULL ||
- g0->n_new_large_words >= large_alloc_lim);
-}
-
-/* -----------------------------------------------------------------------------
The storage manager mutex
-------------------------------------------------------------------------- */
@@ -75,6 +64,17 @@ StgWord countNurseryBlocks (void);
bool getNewNursery (Capability *cap);
/* -----------------------------------------------------------------------------
+ Should we GC?
+ -------------------------------------------------------------------------- */
+
+INLINE_HEADER
+bool doYouWantToGC(Capability *cap)
+{
+ return ((cap->r.rCurrentNursery->link == NULL && !getNewNursery(cap)) ||
+ g0->n_new_large_words >= large_alloc_lim);
+}
+
+/* -----------------------------------------------------------------------------
Allocation accounting
See [Note allocation accounting] in Storage.c