Add optional eager black-holing, with new flag -feager-blackholing
authorSimon Marlow <marlowsd@gmail.com>
Tue, 18 Nov 2008 14:24:42 +0000 (14:24 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Tue, 18 Nov 2008 14:24:42 +0000 (14:24 +0000)
commitd600bf7a6afdbfc4a22f9379406a9c6f789a4c2d
treefc86da89b8891374298c441d14d2333b33e29d53
parent0fa59deb44b8a1a0b44ee2b4cc4ae0db31dec038
Add optional eager black-holing, with new flag -feager-blackholing

Eager blackholing can improve parallel performance by reducing the
chances that two threads perform the same computation.  However, it
has a cost: one extra memory write per thunk entry.

To get the best results, any code which may be executed in parallel
should be compiled with eager blackholing turned on.  But since
there's a cost for sequential code, we make it optional and turn it on
for the parallel package only.  It might be a good idea to compile
applications (or modules) with parallel code in with
-feager-blackholing.

ToDo: document -feager-blackholing.
29 files changed:
compiler/cmm/CLabel.hs
compiler/cmm/CmmExpr.hs
compiler/cmm/PprC.hs
compiler/cmm/PprCmm.hs
compiler/codeGen/CgClosure.lhs
compiler/codeGen/CgUtils.hs
compiler/codeGen/ClosureInfo.lhs
compiler/main/DynFlags.hs
compiler/nativeGen/AsmCodeGen.lhs
includes/ClosureTypes.h
includes/Regs.h
includes/RtsConfig.h
includes/StgMiscClosures.h
includes/mkDerivedConstants.c
rts/Capability.c
rts/ClosureFlags.c
rts/FrontPanel.c
rts/LdvProfile.c
rts/Linker.c
rts/Printer.c
rts/ProfHeap.c
rts/RetainerProfile.c
rts/Sanity.c
rts/StgMiscClosures.cmm
rts/ThreadPaused.c
rts/sm/Compact.c
rts/sm/Evac.c
rts/sm/Scav.c
utils/genapply/GenApply.hs