GC refactoring, remove "steps"
authorSimon Marlow <marlowsd@gmail.com>
Thu, 3 Dec 2009 15:07:28 +0000 (15:07 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Thu, 3 Dec 2009 15:07:28 +0000 (15:07 +0000)
commit214b3663d5d7598c13643f9221e43d5a7735b47f
treede779bab8dbcf057eaf481e6b612b63881e246e9
parent7cb1d9274e84ee2fc2dd610aa4f7686586ca0357
GC refactoring, remove "steps"

The GC had a two-level structure, G generations each of T steps.
Steps are for aging within a generation, mostly to avoid premature
promotion.

Measurements show that more than 2 steps is almost never worthwhile,
and 1 step is usually worse than 2.  In theory fractional steps are
possible, so the ideal number of steps is somewhere between 1 and 3.
GHC's default has always been 2.

We can implement 2 steps quite straightforwardly by having each block
point to the generation to which objects in that block should be
promoted, so blocks in the nursery point to generation 0, and blocks
in gen 0 point to gen 1, and so on.

This commit removes the explicit step structures, merging generations
with steps, thus simplifying a lot of code.  Performance is
unaffected.  The tunable number of steps is now gone, although it may
be replaced in the future by a way to tune the aging in generation 0.
26 files changed:
includes/Cmm.h
includes/mkDerivedConstants.c
includes/rts/storage/Block.h
includes/rts/storage/GC.h
includes/stg/Regs.h
rts/Arena.c
rts/Printer.c
rts/ProfHeap.c
rts/Schedule.c
rts/Stats.c
rts/Threads.c
rts/sm/BlockAlloc.c
rts/sm/Compact.c
rts/sm/Evac.c
rts/sm/GC.c
rts/sm/GCThread.h
rts/sm/GCUtils.c
rts/sm/GCUtils.h
rts/sm/MarkWeak.c
rts/sm/Sanity.c
rts/sm/Sanity.h
rts/sm/Scav.c
rts/sm/Storage.c
rts/sm/Storage.h
rts/sm/Sweep.c
rts/sm/Sweep.h