unsafe.Offsetof(schedt{}.pollUntil),
unsafe.Offsetof(schedt{}.timeToRun),
unsafe.Offsetof(gcControllerState{}.dedicatedMarkWorkersNeeded),
- unsafe.Offsetof(gcControllerState{}.idleMarkTime),
unsafe.Offsetof(timeHistogram{}.underflow),
unsafe.Offsetof(profBuf{}.overflow),
unsafe.Offsetof(profBuf{}.overflowTime),
sweepTermCpu,
gcController.assistTime.Load(),
gcController.dedicatedMarkTime.Load() + gcController.fractionalMarkTime.Load(),
- gcController.idleMarkTime,
+ gcController.idleMarkTime.Load(),
markTermCpu,
} {
if i == 2 || i == 3 {
// running.
fractionalMarkTime atomic.Int64
- // idleMarkTime is the nanoseconds spent in idle marking
- // during this cycle. This is updated atomically throughout
- // the cycle.
- idleMarkTime int64
+ // idleMarkTime is the nanoseconds spent in idle marking during this
+ // cycle. This is updated throughout the cycle.
+ idleMarkTime atomic.Int64
// markStartTime is the absolute start time in nanoseconds
// that assists and background mark workers started.
c.assistTime.Store(0)
c.dedicatedMarkTime.Store(0)
c.fractionalMarkTime.Store(0)
- c.idleMarkTime = 0
+ c.idleMarkTime.Store(0)
c.markStartTime = markStartTime
// TODO(mknyszek): This is supposed to be the actual trigger point for the heap, but
}
idleUtilization := 0.0
if assistDuration > 0 {
- idleUtilization = float64(c.idleMarkTime) / float64(assistDuration*int64(procs))
+ idleUtilization = float64(c.idleMarkTime.Load()) / float64(assistDuration*int64(procs))
}
// Determine the cons/mark ratio.
//
case gcMarkWorkerFractionalMode:
c.fractionalMarkTime.Add(duration)
case gcMarkWorkerIdleMode:
- atomic.Xaddint64(&c.idleMarkTime, duration)
+ c.idleMarkTime.Add(duration)
c.removeIdleMarkWorker()
default:
throw("markWorkerStop: unknown mark worker mode")