diff options
author | Simon Marlow <marlowsd@gmail.com> | 2012-11-16 09:22:00 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2012-11-16 11:26:20 +0000 |
commit | 6d784c43592290ec16db8b7f0f2a012dff3ed497 (patch) | |
tree | a317ef1fc1ee40883e92cde308c292f7125db2b7 /includes | |
parent | 97dc57c6e2bdbddd0a0170a283149a570a07179c (diff) | |
download | haskell-6d784c43592290ec16db8b7f0f2a012dff3ed497.tar.gz |
Add a write barrier for TVAR closures
This improves GC performance when there are a lot of TVars in the
heap. For instance, a TChan with a lot of elements causes a massive
GC drag without this patch.
There's more to do - several other STM closure types don't have write
barriers, so GC performance when there are a lot of threads blocked on
STM isn't great. But fixing the problem for TVar is a good start.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/rts/storage/ClosureTypes.h | 37 | ||||
-rw-r--r-- | includes/stg/MiscClosures.h | 3 |
2 files changed, 21 insertions, 19 deletions
diff --git a/includes/rts/storage/ClosureTypes.h b/includes/rts/storage/ClosureTypes.h index 4e3b1e6a72..d878e965ee 100644 --- a/includes/rts/storage/ClosureTypes.h +++ b/includes/rts/storage/ClosureTypes.h @@ -61,23 +61,24 @@ #define BLACKHOLE 40 #define MVAR_CLEAN 41 #define MVAR_DIRTY 42 -#define ARR_WORDS 43 -#define MUT_ARR_PTRS_CLEAN 44 -#define MUT_ARR_PTRS_DIRTY 45 -#define MUT_ARR_PTRS_FROZEN0 46 -#define MUT_ARR_PTRS_FROZEN 47 -#define MUT_VAR_CLEAN 48 -#define MUT_VAR_DIRTY 49 -#define WEAK 50 -#define PRIM 51 -#define MUT_PRIM 52 -#define TSO 53 -#define STACK 54 -#define TREC_CHUNK 55 -#define ATOMICALLY_FRAME 56 -#define CATCH_RETRY_FRAME 57 -#define CATCH_STM_FRAME 58 -#define WHITEHOLE 59 -#define N_CLOSURE_TYPES 60 +#define TVAR 43 +#define ARR_WORDS 44 +#define MUT_ARR_PTRS_CLEAN 45 +#define MUT_ARR_PTRS_DIRTY 46 +#define MUT_ARR_PTRS_FROZEN0 47 +#define MUT_ARR_PTRS_FROZEN 48 +#define MUT_VAR_CLEAN 49 +#define MUT_VAR_DIRTY 50 +#define WEAK 51 +#define PRIM 52 +#define MUT_PRIM 53 +#define TSO 54 +#define STACK 55 +#define TREC_CHUNK 56 +#define ATOMICALLY_FRAME 57 +#define CATCH_RETRY_FRAME 58 +#define CATCH_STM_FRAME 59 +#define WHITEHOLE 60 +#define N_CLOSURE_TYPES 61 #endif /* RTS_STORAGE_CLOSURETYPES_H */ diff --git a/includes/stg/MiscClosures.h b/includes/stg/MiscClosures.h index af96563e53..61e6b0994f 100644 --- a/includes/stg/MiscClosures.h +++ b/includes/stg/MiscClosures.h @@ -101,6 +101,8 @@ RTS_ENTRY(stg_DEAD_WEAK); RTS_ENTRY(stg_STABLE_NAME); RTS_ENTRY(stg_MVAR_CLEAN); RTS_ENTRY(stg_MVAR_DIRTY); +RTS_ENTRY(stg_TVAR_CLEAN); +RTS_ENTRY(stg_TVAR_DIRTY); RTS_ENTRY(stg_TSO); RTS_ENTRY(stg_STACK); RTS_ENTRY(stg_ARR_WORDS); @@ -130,7 +132,6 @@ RTS_ENTRY(stg_atomically); RTS_ENTRY(stg_TVAR_WATCH_QUEUE); RTS_ENTRY(stg_INVARIANT_CHECK_QUEUE); RTS_ENTRY(stg_ATOMIC_INVARIANT); -RTS_ENTRY(stg_TVAR); RTS_ENTRY(stg_TREC_CHUNK); RTS_ENTRY(stg_TREC_HEADER); RTS_ENTRY(stg_END_STM_WATCH_QUEUE); |