Make clearNursery free
ClosedPublic

Authored by simonmar on Oct 7 2014, 5:21 AM.

Details

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

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Branch
clearNursery
Lint
Lint ErrorsExcuse: not this diff
SeverityLocationCodeMessage
Errorrts/Capability.h:161TXT2Tab Literal
Errorrts/Schedule.c:150TXT2Tab Literal
Errorrts/Stats.c:180TXT2Tab Literal
Unit
No Unit Test Coverage
Build Status
Buildable 1167
Build 1172: GHC Patch Validation (amd64/Linux)
simonmar updated this revision to Diff 796.Oct 7 2014, 5:21 AM
simonmar retitled this revision from to Make clearNursery free.
simonmar updated this object.
simonmar edited the test plan for this revision. (Show Details)
simonmar added reviewers: austin, AndreasVoellmy, ezyang.
ezyang accepted this revision.Oct 7 2014, 9:58 AM
ezyang edited edge metadata.

This is great; I recently cooked a similar patch but I didn't handle the reporting properly.

I think this solves https://ghc.haskell.org/trac/ghc/ticket/9067#

simonmar updated this revision to Diff 812.Oct 7 2014, 1:10 PM
simonmar edited edge metadata.

fix a bug

AndreasVoellmy accepted this revision.Oct 7 2014, 3:09 PM
AndreasVoellmy edited edge metadata.

Cool! Do we have any benchmarks?

Looks good to me, though I'm a bit rusty now on some of the code involved so I may not spot problems.

I'm going to run some benchmarks before I commit.

thomie edited edge metadata.Nov 9 2014, 10:51 AM
thomie updated the Trac tickets for this revision.
austin accepted this revision.Nov 18 2014, 9:48 PM
austin edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Nov 18 2014, 9:48 PM
This revision was automatically updated to reflect the committed changes.