@@ -275,11 +275,11 @@ type gcControllerState struct {
275
275
// phase.
276
276
dedicatedMarkTime atomic.Int64
277
277
278
- // fractionalMarkTime is the nanoseconds spent in the
279
- // fractional mark worker during this cycle. This is updated
280
- // atomically throughout the cycle and will be up-to-date if
281
- // the fractional mark worker is not currently running.
282
- fractionalMarkTime int64
278
+ // fractionalMarkTime is the nanoseconds spent in the fractional mark
279
+ // worker during this cycle. This is updated throughout the cycle and
280
+ // will be up-to-date if the fractional mark worker is not currently
281
+ // running.
282
+ fractionalMarkTime atomic. Int64
283
283
284
284
// idleMarkTime is the nanoseconds spent in idle marking
285
285
// during this cycle. This is updated atomically throughout
@@ -419,7 +419,7 @@ func (c *gcControllerState) startCycle(markStartTime int64, procs int, trigger g
419
419
c .bgScanCredit .Store (0 )
420
420
c .assistTime .Store (0 )
421
421
c .dedicatedMarkTime .Store (0 )
422
- c .fractionalMarkTime = 0
422
+ c .fractionalMarkTime . Store ( 0 )
423
423
c .idleMarkTime = 0
424
424
c .markStartTime = markStartTime
425
425
@@ -908,7 +908,7 @@ func (c *gcControllerState) markWorkerStop(mode gcMarkWorkerMode, duration int64
908
908
c .dedicatedMarkTime .Add (duration )
909
909
atomic .Xaddint64 (& c .dedicatedMarkWorkersNeeded , 1 )
910
910
case gcMarkWorkerFractionalMode :
911
- atomic . Xaddint64 ( & c .fractionalMarkTime , duration )
911
+ c .fractionalMarkTime . Add ( duration )
912
912
case gcMarkWorkerIdleMode :
913
913
atomic .Xaddint64 (& c .idleMarkTime , duration )
914
914
c .removeIdleMarkWorker ()
0 commit comments