diff options
| author | Ben Gamari <ben@smart-cactus.org> | 2019-09-28 17:37:35 +0000 |
|---|---|---|
| committer | Ben Gamari <ben@well-typed.com> | 2020-12-01 12:48:54 -0500 |
| commit | f9ed0fd23dca0515c4281e7a0d8c8ae1ee4af46f (patch) | |
| tree | 3f46b6e3f4d88900c9317a333b03ba4205586501 | |
| parent | bfe39b7fb0ab7aca2b6ff713ed8893f33379ae8f (diff) | |
| download | haskell-f9ed0fd23dca0515c4281e7a0d8c8ae1ee4af46f.tar.gz | |
rts: Use relaxed atomics for whitehole spin stats
| -rw-r--r-- | rts/SMPClosureOps.h | 4 | ||||
| -rw-r--r-- | rts/ThreadPaused.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/rts/SMPClosureOps.h b/rts/SMPClosureOps.h index 3191a8c600..2df88db06c 100644 --- a/rts/SMPClosureOps.h +++ b/rts/SMPClosureOps.h @@ -62,12 +62,12 @@ EXTERN_INLINE StgInfoTable *reallyLockClosure(StgClosure *p) info = xchg((P_)(void *)&p->header.info, (W_)&stg_WHITEHOLE_info); if (info != (W_)&stg_WHITEHOLE_info) return (StgInfoTable *)info; #if defined(PROF_SPIN) - ++whitehole_lockClosure_spin; + NONATOMIC_ADD(&whitehole_lockClosure_spin, 1); #endif busy_wait_nop(); } while (++i < SPIN_COUNT); #if defined(PROF_SPIN) - ++whitehole_lockClosure_yield; + NONATOMIC_ADD(&whitehole_lockClosure_yield, 1); #endif yieldThread(); } while (1); diff --git a/rts/ThreadPaused.c b/rts/ThreadPaused.c index 3404c20418..13fc2b4ca0 100644 --- a/rts/ThreadPaused.c +++ b/rts/ThreadPaused.c @@ -331,7 +331,7 @@ threadPaused(Capability *cap, StgTSO *tso) if (cur_bh_info != bh_info) { bh_info = cur_bh_info; #if defined(PROF_SPIN) - ++whitehole_threadPaused_spin; + NONATOMIC_ADD(&whitehole_threadPaused_spin, 1); #endif busy_wait_nop(); goto retry; |
