summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
authorEdward Z. Yang <ezyang@mit.edu>2013-04-07 16:31:44 -0700
committerEdward Z. Yang <ezyang@mit.edu>2013-04-22 15:35:01 -0700
commit5724ea01c943bbc78b6c8b6bfa01a5d026d42f5a (patch)
tree479847c9ec637ffd3102b798f3251c59a81f4787 /rts
parent2a7f4de3d3d5fc515725af941f332d69997185dc (diff)
downloadhaskell-5724ea01c943bbc78b6c8b6bfa01a5d026d42f5a.tar.gz
More accurate cost attribution for stacks. Fixes #7818.
Previously, stacks were always attributed to CCCS_SYSTEM. Now, we attribute them to the CCS when the stack was allocated. If a stack grows, new stack chunks inherit the CCS of the old stack. Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
Diffstat (limited to 'rts')
-rw-r--r--rts/Threads.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/rts/Threads.c b/rts/Threads.c
index b6176163ad..4c990f118c 100644
--- a/rts/Threads.c
+++ b/rts/Threads.c
@@ -84,7 +84,7 @@ createThread(Capability *cap, W_ size)
stack_size = round_to_mblocks(size - sizeofW(StgTSO));
stack = (StgStack *)allocate(cap, stack_size);
TICK_ALLOC_STACK(stack_size);
- SET_HDR(stack, &stg_STACK_info, CCS_SYSTEM);
+ SET_HDR(stack, &stg_STACK_info, cap->r.rCCCS);
stack->stack_size = stack_size - sizeofW(StgStack);
stack->sp = stack->stack + stack->stack_size;
stack->dirty = 1;
@@ -575,7 +575,7 @@ threadStackOverflow (Capability *cap, StgTSO *tso)
chunk_size * sizeof(W_));
new_stack = (StgStack*) allocate(cap, chunk_size);
- SET_HDR(new_stack, &stg_STACK_info, CCS_SYSTEM);
+ SET_HDR(new_stack, &stg_STACK_info, old_stack->header.prof.ccs);
TICK_ALLOC_STACK(chunk_size);
new_stack->dirty = 0; // begin clean, we'll mark it dirty below