X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FThreadPaused.c;h=75712b04d613364a3b2dabbf1f3e8b0429473cef;hb=0c658578d609f93a25a8dff97b5cead055b246e3;hp=58c30e330e1a147abe5066c0a1a049a1aa9f7f30;hpb=a2a67cd520b9841114d69a87a423dabcb3b4368e;p=ghc-hetmet.git diff --git a/rts/ThreadPaused.c b/rts/ThreadPaused.c index 58c30e3..75712b0 100644 --- a/rts/ThreadPaused.c +++ b/rts/ThreadPaused.c @@ -28,7 +28,7 @@ struct stack_gap { StgWord gap_size; struct stack_gap *next_gap; }; static void -stackSqueeze(StgTSO *tso, StgPtr bottom) +stackSqueeze(Capability *cap, StgTSO *tso, StgPtr bottom) { StgPtr frame; rtsBool prev_was_update_frame; @@ -75,7 +75,7 @@ stackSqueeze(StgTSO *tso, StgPtr bottom) * screw us up if we don't check. */ if (upd->updatee != updatee && !closure_IND(upd->updatee)) { - UPD_IND(upd->updatee, updatee); + UPD_IND(cap, upd->updatee, updatee); } // now mark this update frame as a stack gap. The gap @@ -315,7 +315,13 @@ end: // the number of words we have to shift down is less than the // number of stack words we squeeze away by doing so. if (RtsFlags.GcFlags.squeezeUpdFrames == rtsTrue && - ((weight <= 5 && words_to_squeeze > 0) || weight < words_to_squeeze)) { - stackSqueeze(tso, (StgPtr)frame); + ((weight <= 8 && words_to_squeeze > 0) || weight < words_to_squeeze)) { + // threshold above bumped from 5 to 8 as a result of #2797 + stackSqueeze(cap, tso, (StgPtr)frame); + tso->flags |= TSO_SQUEEZED; + // This flag tells threadStackOverflow() that the stack was + // squeezed, because it may not need to be expanded. + } else { + tso->flags &= ~TSO_SQUEEZED; } }