diff options
author | Simon Marlow <marlowsd@gmail.com> | 2010-01-22 16:49:11 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2010-01-22 16:49:11 +0000 |
commit | 65ac2f4cefcea7ca78a65ca22889b51b5a27d1f0 (patch) | |
tree | a841ea73d574bbda83eb387c8db530c342eb84e9 /includes/rts/storage/SMPClosureOps.h | |
parent | f1d99ae043da2a4825d88756275477d82d92c967 (diff) | |
download | haskell-65ac2f4cefcea7ca78a65ca22889b51b5a27d1f0.tar.gz |
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.
Diffstat (limited to 'includes/rts/storage/SMPClosureOps.h')
-rw-r--r-- | includes/rts/storage/SMPClosureOps.h | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/includes/rts/storage/SMPClosureOps.h b/includes/rts/storage/SMPClosureOps.h index d5f7c3f295..582ec0e959 100644 --- a/includes/rts/storage/SMPClosureOps.h +++ b/includes/rts/storage/SMPClosureOps.h @@ -28,8 +28,6 @@ EXTERN_INLINE void unlockClosure(StgClosure *p, const StgInfoTable *info); * This is used primarily in the implementation of MVars. * -------------------------------------------------------------------------- */ -#define SPIN_COUNT 4000 - // We want a callable copy of lockClosure() so that we can refer to it // from .cmm files compiled using the native codegen. EXTERN_INLINE StgInfoTable *lockClosure(StgClosure *p) |