summaryrefslogtreecommitdiff
path: root/includes/Regs.h
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2009-03-13 10:45:16 +0000
committerSimon Marlow <marlowsd@gmail.com>2009-03-13 10:45:16 +0000
commit304e7fb703e7afddc1ef9be6aab6505e36b63b06 (patch)
tree578332aa77e0c1c2d176218d23ae0beb0afd98af /includes/Regs.h
parentc197fe602ed4aadf09affe0cdc18e7158d262012 (diff)
downloadhaskell-304e7fb703e7afddc1ef9be6aab6505e36b63b06.tar.gz
Instead of a separate context-switch flag, set HpLim to zero
This reduces the latency between a context-switch being triggered and the thread returning to the scheduler, which in turn should reduce the cost of the GC barrier when there are many cores. We still retain the old context_switch flag which is checked at the end of each block of allocation. The idea is that setting HpLim may fail if the the target thread is modifying HpLim at the same time; the context_switch flag is a fallback. It also allows us to "context switch soon" without forcing an immediate switch, which can be costly.
Diffstat (limited to 'includes/Regs.h')
-rw-r--r--includes/Regs.h13
1 files changed, 1 insertions, 12 deletions
diff --git a/includes/Regs.h b/includes/Regs.h
index 45f9149af5..29c04b302f 100644
--- a/includes/Regs.h
+++ b/includes/Regs.h
@@ -133,7 +133,6 @@ typedef struct StgRegTable_ {
#define SAVE_SpLim (CurrentTSO->splim)
#define SAVE_Hp (BaseReg->rHp)
-#define SAVE_HpLim (BaseReg->rHpLim)
#define SAVE_CurrentTSO (BaseReg->rCurrentTSO)
#define SAVE_CurrentNursery (BaseReg->rCurrentNursery)
@@ -349,7 +348,7 @@ GLOBAL_REG_DECL(P_,Hp,REG_Hp)
#endif
#if defined(REG_HpLim) && !defined(NO_GLOBAL_REG_DECLS)
-GLOBAL_REG_DECL(P_,HpLim,REG_HpLim)
+#error HpLim cannot be in a register
#else
#define HpLim (BaseReg->rHpLim)
#endif
@@ -570,14 +569,6 @@ GLOBAL_REG_DECL(bdescr *,HpAlloc,REG_HpAlloc)
#define CALLER_RESTORE_Hp /* nothing */
#endif
-#ifdef CALLER_SAVES_HpLim
-#define CALLER_SAVE_HpLim SAVE_HpLim = HpLim;
-#define CALLER_RESTORE_HpLim HpLim = SAVE_HpLim;
-#else
-#define CALLER_SAVE_HpLim /* nothing */
-#define CALLER_RESTORE_HpLim /* nothing */
-#endif
-
#ifdef CALLER_SAVES_Base
#ifdef THREADED_RTS
#error "Can't have caller-saved BaseReg with THREADED_RTS"
@@ -644,7 +635,6 @@ GLOBAL_REG_DECL(bdescr *,HpAlloc,REG_HpAlloc)
CALLER_SAVE_Sp \
CALLER_SAVE_SpLim \
CALLER_SAVE_Hp \
- CALLER_SAVE_HpLim \
CALLER_SAVE_CurrentTSO \
CALLER_SAVE_CurrentNursery \
CALLER_SAVE_Base
@@ -673,7 +663,6 @@ GLOBAL_REG_DECL(bdescr *,HpAlloc,REG_HpAlloc)
CALLER_RESTORE_Sp \
CALLER_RESTORE_SpLim \
CALLER_RESTORE_Hp \
- CALLER_RESTORE_HpLim \
CALLER_RESTORE_CurrentTSO \
CALLER_RESTORE_CurrentNursery