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 /rts/Printer.c | |
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 'rts/Printer.c')
-rw-r--r-- | rts/Printer.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/rts/Printer.c b/rts/Printer.c index 4f9f83db52..db2e7be8c8 100644 --- a/rts/Printer.c +++ b/rts/Printer.c @@ -162,6 +162,12 @@ printClosure( StgClosure *obj ) printStdObjPayload(obj); break; + case MUT_PRIM: + debugBelch("MUT_PRIM("); + printPtr((StgPtr)obj->header.info); + printStdObjPayload(obj); + break; + case THUNK: case THUNK_1_0: case THUNK_0_1: case THUNK_1_1: case THUNK_0_2: case THUNK_2_0: @@ -324,6 +330,13 @@ printClosure( StgClosure *obj ) break; } + case TVAR: + { + StgTVar* tv = (StgTVar*)obj; + debugBelch("TVAR(value=%p, wq=%p, num_updates=%" FMT_Word ")\n", tv->current_value, tv->first_watch_queue_entry, tv->num_updates); + break; + } + case MUT_VAR_CLEAN: { StgMutVar* mv = (StgMutVar*)obj; @@ -1089,6 +1102,7 @@ char *closure_type_names[] = { [BLACKHOLE] = "BLACKHOLE", [MVAR_CLEAN] = "MVAR_CLEAN", [MVAR_DIRTY] = "MVAR_DIRTY", + [TVAR] = "TVAR", [ARR_WORDS] = "ARR_WORDS", [MUT_ARR_PTRS_CLEAN] = "MUT_ARR_PTRS_CLEAN", [MUT_ARR_PTRS_DIRTY] = "MUT_ARR_PTRS_DIRTY", |