From 6d784c43592290ec16db8b7f0f2a012dff3ed497 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Fri, 16 Nov 2012 09:22:00 +0000 Subject: 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. --- rts/sm/Storage.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'rts/sm/Storage.h') diff --git a/rts/sm/Storage.h b/rts/sm/Storage.h index 05690d0a4f..65f5242c31 100644 --- a/rts/sm/Storage.h +++ b/rts/sm/Storage.h @@ -69,10 +69,11 @@ extern Mutex sm_mutex; #endif /* ----------------------------------------------------------------------------- - The write barrier for MVARs + The write barrier for MVARs and TVARs -------------------------------------------------------------------------- */ void dirty_MVAR(StgRegTable *reg, StgClosure *p); +void dirty_TVAR(Capability *cap, StgTVar *p); /* ----------------------------------------------------------------------------- Nursery manipulation -- cgit v1.2.1