diff options
author | Simon Marlow <marlowsd@gmail.com> | 2009-03-13 10:45:16 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2009-03-13 10:45:16 +0000 |
commit | 304e7fb703e7afddc1ef9be6aab6505e36b63b06 (patch) | |
tree | 578332aa77e0c1c2d176218d23ae0beb0afd98af /includes | |
parent | c197fe602ed4aadf09affe0cdc18e7158d262012 (diff) | |
download | haskell-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')
-rw-r--r-- | includes/MachRegs.h | 27 | ||||
-rw-r--r-- | includes/Regs.h | 13 |
2 files changed, 10 insertions, 30 deletions
diff --git a/includes/MachRegs.h b/includes/MachRegs.h index adc132bfe8..f51f782806 100644 --- a/includes/MachRegs.h +++ b/includes/MachRegs.h @@ -95,7 +95,6 @@ s0 $9 Sp s2 $11 SpLim s3 $12 Hp - s4 $13 HpLim t8 $22 NCG_reserved t12 $27 NCG_reserved -------------------------------------------------------------------------- */ @@ -134,7 +133,6 @@ # define REG_SpLim 11 # define REG_Hp 12 -# define REG_HpLim 13 # define NCG_Reserved_I1 22 # define NCG_Reserved_I2 27 @@ -189,7 +187,6 @@ #define REG_SpLim r6 #define REG_Hp r7 -#define REG_HpLim r8 #define NCG_Reserved_I1 r28 #define NCG_Reserved_I2 r29 @@ -215,7 +212,7 @@ esi R1 edi Hp - Leaving SpLim, and HpLim out of the picture. + Leaving SpLim out of the picture. -------------------------------------------------------------------------- */ @@ -284,12 +281,12 @@ #define REG_Sp rbp #define REG_Hp r12 #define REG_R1 rbx -#define REG_R2 rsi -#define REG_R3 rdi -#define REG_R4 r8 -#define REG_R5 r9 -#define REG_SpLim r14 -#define REG_HpLim r15 +#define REG_R2 r14 +#define REG_R3 rsi +#define REG_R4 rdi +#define REG_R5 r8 +#define REG_R6 r9 +#define REG_SpLim r15 #define REG_F1 xmm1 #define REG_F2 xmm2 @@ -299,10 +296,10 @@ #define REG_D1 xmm5 #define REG_D2 xmm6 -#define CALLER_SAVES_R2 #define CALLER_SAVES_R3 #define CALLER_SAVES_R4 #define CALLER_SAVES_R5 +#define CALLER_SAVES_R6 #define CALLER_SAVES_F1 #define CALLER_SAVES_F2 @@ -312,7 +309,7 @@ #define CALLER_SAVES_D1 #define CALLER_SAVES_D2 -#define MAX_REAL_VANILLA_REG 5 +#define MAX_REAL_VANILLA_REG 6 #define MAX_REAL_FLOAT_REG 4 #define MAX_REAL_DOUBLE_REG 2 #define MAX_REAL_LONG_REG 0 @@ -361,7 +358,6 @@ #define REG_SpLim d3 #define REG_Hp d4 -#define REG_HpLim d5 #define REG_R1 a5 #define REG_R2 d6 @@ -425,7 +421,6 @@ #define REG_SpLim 21 #define REG_Hp 22 -#define REG_HpLim 23 #define REG_Base 30 @@ -500,7 +495,6 @@ #define REG_SpLim r24 #define REG_Hp r25 -#define REG_HpLim r26 #define REG_Base r27 @@ -543,7 +537,6 @@ #define REG_SpLim loc26 #define REG_Hp loc27 -#define REG_HpLim loc28 #endif /* ia64 */ @@ -597,7 +590,6 @@ %i1 Base %i2 SpLim %i3 Hp - %i4 HpLim %i5 R6 %i6 C frame ptr %i7 C ret addr @@ -666,7 +658,6 @@ #define REG_SpLim i2 #define REG_Hp i3 -#define REG_HpLim i4 #define REG_Base i1 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 |