Make clearNursery free
authorSimon Marlow <marlowsd@gmail.com>
Tue, 7 Oct 2014 09:30:36 +0000 (10:30 +0100)
committerSimon Marlow <marlowsd@gmail.com>
Tue, 25 Nov 2014 14:37:26 +0000 (14:37 +0000)
commite22bc0dedb9e9da0176ad7ce4a74acbefedc7207
tree8a8872279576edf6824c25bf31accd793d970fd8
parente159e08a5e1c1f9f7b6805f3f0775333104c3d6e
Make clearNursery free

Summary:
clearNursery resets all the bd->free pointers of nursery blocks to
make the blocks empty.  In profiles we've seen clearNursery taking
significant amounts of time particularly with large -N and -A values.

This patch moves the work of clearNursery to the point at which we
actually need the new block, thereby introducing an invariant that
blocks to the right of the CurrentNursery pointer still need their
bd->free pointer reset.  This should make things faster overall,
because we don't need to clear blocks that we don't use.

Test Plan: validate

Reviewers: AndreasVoellmy, ezyang, austin

Subscribers: thomie, carter, ezyang, simonmar

Differential Revision: https://phabricator.haskell.org/D318
includes/rts/storage/GC.h
rts/Capability.h
rts/HeapStackCheck.cmm
rts/Schedule.c
rts/Stats.c
rts/sm/Storage.c
rts/sm/Storage.h
testsuite/tests/codeGen/should_run/all.T
testsuite/tests/codeGen/should_run/cgrun074.hs [new file with mode: 0644]
testsuite/tests/codeGen/should_run/cgrun074.stdout [new file with mode: 0644]
utils/deriveConstants/DeriveConstants.hs