Lines Matching full:gp
131 forEachGRace(func(gp *g) {
136 if !gp.gcscandone {
137 println("gp", gp, "goid", gp.goid,
138 "status", readgstatus(gp),
139 "gcscandone", gp.gcscandone)
201 gp := work.stackRoots[i-work.baseStacks]
205 status := readgstatus(gp) // We are not in a scan state
206 if (status == _Gwaiting || status == _Gsyscall) && gp.waitsince == 0 {
207 gp.waitsince = work.tstart
218 selfScan := gp == userG && readgstatus(userG) == _Grunning
223 // TODO: suspendG blocks (and spins) until gp
230 stopped := suspendG(gp)
232 gp.gcscandone = true
235 if gp.gcscandone {
238 workDone += scanstack(gp, gcw)
239 gp.gcscandone = true
303 for gp := list.head.ptr(); gp != nil; gp = gp.schedlink.ptr() {
304 stackfree(gp.stack)
305 gp.stack.lo = 0
306 gp.stack.hi = 0
309 q.tail.set(gp)
411 // gcAssistAlloc performs GC work to make gp's assist debt positive.
412 // gp must be the calling user goroutine.
415 func gcAssistAlloc(gp *g) {
418 if getg() == gp.m.g0 {
453 gp.inMarkAssist = false
459 gp.inMarkAssist = false
470 debtBytes := -gp.gcAssistBytes
488 gp.gcAssistBytes += 1 + int64(assistBytesPerWork*float64(stolen))
491 gp.gcAssistBytes += debtBytes
511 gp.inMarkAssist = false
517 gp.inMarkAssist = false
529 gp.inMarkAssist = true
532 gp.inMarkAssist = true
544 gcAssistAlloc1(gp, scanWork)
549 completed := gp.param != nil
550 gp.param = nil
555 if gp.gcAssistBytes < 0 {
563 if gp.preempt {
595 gp.inMarkAssist = false
601 gp.inMarkAssist = false
612 // phase by setting gp.param to non-nil. This can't be communicated on
616 func gcAssistAlloc1(gp *g, scanWork int64) {
619 gp.param = nil
629 gp.gcAssistBytes = 0
639 trackLimiterEvent := gp.m.p.ptr().limiterEvent.start(limiterEventMarkAssist, startTime)
648 casGToWaitingForGC(gp, _Grunning, waitReasonGCAssistMarking)
655 casgstatus(gp, _Gwaiting, _Grunning)
664 gp.gcAssistBytes += 1 + int64(assistBytesPerWork*float64(workDone))
677 // gp.param to a non-nil value to indicate this. It
680 gp.param = unsafe.Pointer(gp)
684 pp := gp.m.p.ptr()
720 gp := getg()
722 work.assistQueue.q.pushBack(gp)
766 gp := work.assistQueue.q.pop()
767 // Note that gp.gcAssistBytes is negative because gp
769 if scanBytes+gp.gcAssistBytes >= 0 {
771 scanBytes += gp.gcAssistBytes
772 gp.gcAssistBytes = 0
773 // It's important that we *not* put gp in
779 ready(gp, 0, false)
782 gp.gcAssistBytes += scanBytes
788 work.assistQueue.q.pushBack(gp)
802 // scanstack scans gp's stack, greying all pointers found on the stack.
819 func scanstack(gp *g, gcw *gcWork) int64 {
820 if readgstatus(gp)&_Gscan == 0 {
821 …print("runtime:scanstack: gp=", gp, ", goid=", gp.goid, ", gp->atomicstatus=", hex(readgstatus(gp)…
825 switch readgstatus(gp) &^ _Gscan {
827 print("runtime: gp=", gp, ", goid=", gp.goid, ", gp->atomicstatus=", readgstatus(gp), "\n")
832 print("runtime: gp=", gp, ", goid=", gp.goid, ", gp->atomicstatus=", readgstatus(gp), "\n")
838 if gp == getg() {
846 if gp.syscallsp != 0 {
847 …sp = gp.syscallsp // If in a system call this is the stack pointer (gp.sched.sp can be 0 in this c…
849 sp = gp.sched.sp
851 scannedSize := gp.stack.hi - sp
859 if isShrinkStackSafe(gp) {
861 shrinkstack(gp)
864 gp.preemptShrink = true
868 state.stack = gp.stack
871 println("stack trace goroutine", gp.goid)
874 if debugScanConservative && gp.asyncSafePoint {
875 …print("scanning async preempted goroutine ", gp.goid, " stack [", hex(gp.stack.lo), ",", hex(gp.st…
881 if gp.sched.ctxt != nil {
882 scanblock(uintptr(unsafe.Pointer(&gp.sched.ctxt)), goarch.PtrSize, &oneptrmask[0], gcw, &state)
887 for u.init(gp, 0); u.valid(); u.next() {
895 for d := gp._defer; d != nil; d = d.link {
913 if gp._panic != nil {
915 state.putPtr(uintptr(unsafe.Pointer(gp._panic)), false)
987 println(" dead stkobj at", hex(gp.stack.lo+uintptr(obj.off)), "of size", obj.r.size)
1158 gp := getg().m.curg
1159 pp := gp.m.p.ptr()
1183 for !(gp.preempt && (preemptible || sched.gcwaiting.Load() || pp.runSafePointFn != 0)) {
1200 // TODO(mknyszek): Consider always checking gp.preempt instead
1205 for !(gp.preempt && (preemptible || sched.gcwaiting.Load() || pp.runSafePointFn != 0)) {
1288 gp := getg().m.curg
1289 for !gp.preempt && !gcCPULimiter.limiting() && workFlushed+gcw.heapScanWork < scanWork {