Use work-stealing for load-balancing in the GC
authorSimon Marlow <marlowsd@gmail.com>
Fri, 13 Mar 2009 13:51:16 +0000 (13:51 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Fri, 13 Mar 2009 13:51:16 +0000 (13:51 +0000)
commit4e3542263207ae49963811aeb84927027e7bb61d
tree90814c02010977694748704fc96bf4347bf2104f
parent8fda9784f1eff82aa243073fd31b181080be3109
Use work-stealing for load-balancing in the GC

New flag: "+RTS -qb" disables load-balancing in the parallel GC
(though this is subject to change, I think we will probably want to do
something more automatic before releasing this).

To get the "PARGC3" configuration described in the "Runtime support
for Multicore Haskell" paper, use "+RTS -qg0 -qb -RTS".

The main advantage of this is that it allows us to easily disable
load-balancing altogether, which turns out to be important in parallel
programs.  Maintaining locality is sometimes more important that
spreading the work out in parallel GC.  There is a side benefit in
that the parallel GC should have improved locality even when
load-balancing, because each processor prefers to take work from its
own queue before stealing from others.
13 files changed:
includes/RtsFlags.h
includes/Storage.h
rts/RtsFlags.c
rts/Stats.c
rts/parallel/WSDeque.c
rts/parallel/WSDeque.h
rts/sm/GC.c
rts/sm/GC.h
rts/sm/GCThread.h
rts/sm/GCUtils.c
rts/sm/GCUtils.h
rts/sm/Scav.c
rts/sm/Storage.c