summaryrefslogtreecommitdiff
path: root/rts/RetainerProfile.c
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2012-11-16 09:22:00 +0000
committerSimon Marlow <marlowsd@gmail.com>2012-11-16 11:26:20 +0000
commit6d784c43592290ec16db8b7f0f2a012dff3ed497 (patch)
treea317ef1fc1ee40883e92cde308c292f7125db2b7 /rts/RetainerProfile.c
parent97dc57c6e2bdbddd0a0170a283149a570a07179c (diff)
downloadhaskell-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 'rts/RetainerProfile.c')
-rw-r--r--rts/RetainerProfile.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/rts/RetainerProfile.c b/rts/RetainerProfile.c
index 24745eae1a..44df06a40d 100644
--- a/rts/RetainerProfile.c
+++ b/rts/RetainerProfile.c
@@ -505,6 +505,7 @@ push( StgClosure *c, retainer c_child_r, StgClosure **first_child )
break;
// layout.payload.ptrs, no SRT
+ case TVAR:
case CONSTR:
case PRIM:
case MUT_PRIM:
@@ -844,7 +845,8 @@ pop( StgClosure **c, StgClosure **cp, retainer *r )
return;
}
- case CONSTR:
+ case TVAR:
+ case CONSTR:
case PRIM:
case MUT_PRIM:
case BCO:
@@ -1009,6 +1011,7 @@ isRetainer( StgClosure *c )
case MUT_PRIM:
case MVAR_CLEAN:
case MVAR_DIRTY:
+ case TVAR:
case MUT_VAR_CLEAN:
case MUT_VAR_DIRTY:
case MUT_ARR_PTRS_CLEAN: