patch applied (ghc-6.12/ghc): When acquiring a spinlock,
yieldThread() every 1000 spins (#3553, #3758)
igloo at earth.li
Tue Jan 26 20:07:33 EST 2010
Fri Jan 22 08:49:11 PST 2010 Simon Marlow <marlowsd at gmail.com>
* When acquiring a spinlock, yieldThread() every 1000 spins (#3553, #3758)
This helps when the thread holding the lock has been descheduled,
which is the main cause of the "last-core slowdown" problem. With
this patch, I get much better results with -N8 on an 8-core box,
although some benchmarks are still worse than with 7 cores.
I also added a yieldThread() into the any_work() loop of the parallel
GC when it has no work to do. Oddly, this seems to improve performance
on the parallel GC benchmarks even when all the cores are busy.
Perhaps it is due to reducing contention on the memory bus.
M ./includes/rts/Constants.h +9
M ./includes/rts/SpinLock.h -11 +18
M ./includes/rts/storage/SMPClosureOps.h -2
M ./rts/sm/GC.c +3
View patch online:
More information about the Cvs-ghc