X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FCapability.c;h=bd781e9cd7b4f9740655bd90a5861728f008c98a;hb=8ae8c865716e0ee03383ddfae58ab778ce527412;hp=8cfcba0b88c34fc6e3ad4c7b865041ff62b0601f;hpb=03a58fc9816fbd5df44adb9d77afdbf9944cc120;p=ghc-hetmet.git diff --git a/rts/Capability.c b/rts/Capability.c index 8cfcba0..bd781e9 100644 --- a/rts/Capability.c +++ b/rts/Capability.c @@ -77,7 +77,7 @@ findSpark (Capability *cap) rtsBool retry; nat i = 0; - if (!emptyRunQueue(cap)) { + if (!emptyRunQueue(cap) || cap->returning_tasks_hd != NULL) { // If there are other threads, don't try to run any new // sparks: sparks might be speculative, we don't want to take // resources away from the main computation. @@ -98,7 +98,7 @@ findSpark (Capability *cap) cap->sparks_converted++; // Post event for running a spark from capability's own pool. - traceSchedEvent(cap, EVENT_RUN_SPARK, cap->r.rCurrentTSO, 0); + traceEventRunSpark(cap, cap->r.rCurrentTSO); return spark; } @@ -132,8 +132,7 @@ findSpark (Capability *cap) if (spark != NULL) { cap->sparks_converted++; - traceSchedEvent(cap, EVENT_STEAL_SPARK, - cap->r.rCurrentTSO, robbed->no); + traceEventStealSpark(cap, cap->r.rCurrentTSO, robbed->no); return spark; } @@ -213,7 +212,6 @@ initCapability( Capability *cap, nat i ) cap->no = i; cap->in_haskell = rtsFalse; - cap->in_gc = rtsFalse; cap->run_queue_hd = END_TSO_QUEUE; cap->run_queue_tl = END_TSO_QUEUE; @@ -253,6 +251,7 @@ initCapability( Capability *cap, nat i ) cap->free_trec_headers = NO_TREC; cap->transaction_tokens = 0; cap->context_switch = 0; + cap->pinned_object_block = NULL; } /* --------------------------------------------------------------------------- @@ -579,9 +578,9 @@ yieldCapability (Capability** pCap, Task *task) Capability *cap = *pCap; if (waiting_for_gc == PENDING_GC_PAR) { - traceSchedEvent(cap, EVENT_GC_START, 0, 0); + traceEventGcStart(cap); gcWorkerThread(cap); - traceSchedEvent(cap, EVENT_GC_END, 0, 0); + traceEventGcEnd(cap); return; } @@ -788,7 +787,7 @@ shutdownCapability (Capability *cap, Task *task, rtsBool safe) continue; } - traceSchedEvent(cap, EVENT_SHUTDOWN, 0, 0); + traceEventShutdown(cap); RELEASE_LOCK(&cap->lock); break; } @@ -830,6 +829,7 @@ static void freeCapability (Capability *cap) { stgFree(cap->mut_lists); + stgFree(cap->saved_mut_lists); #if defined(THREADED_RTS) freeSparkPool(cap->sparks); #endif