pkg runtime (openbsd-amd64-cgo), const EWOULDBLOCK ideal-int
pkg runtime (openbsd-amd64-cgo), const HW_NCPU = 3
pkg runtime (openbsd-amd64-cgo), const HW_NCPU ideal-int
-pkg runtime, func GCcheckmarkdisable()
-pkg runtime, func GCcheckmarkenable()
problem with allocfreetrace=1 in order to understand the type
of the badly updated word.
+ gccheckmark: setting gccheckmark=1 enables verification of the
+ garbage collector's concurrent mark phase by performing a
+ second mark pass while the world is stopped. If the second
+ pass finds a reachable object that was not found by concurrent
+ mark, the garbage collector will panic.
+
The GOMAXPROCS variable limits the number of operating system threads that
can execute user-level Go code simultaneously. There is no limit to the number of threads
that can be blocked in system calls on behalf of Go code; those do not count against
}
}
-func GCcheckmarkenable() {
- systemstack(gccheckmarkenable_m)
-}
-
-func GCcheckmarkdisable() {
- systemstack(gccheckmarkdisable_m)
-}
-
// gctimes records the time in nanoseconds of each phase of the concurrent GC.
type gctimes struct {
sweepterm int64 // stw
// When marking an object if the bool checkmark is true one uses the above
// encoding, otherwise one uses the bitMarked bit in the lower two bits
// of the nibble.
-var (
- checkmark = false
- gccheckmarkenable = true
-)
+var checkmark = false
// inheap reports whether b is a pointer into a (potentially dead) heap object.
// It returns false for pointers into stack spans.
continue
}
- if mheap_.shadow_enabled && debug.wbshadow >= 2 && gccheckmarkenable && checkmark {
+ if mheap_.shadow_enabled && debug.wbshadow >= 2 && debug.gccheckmark > 0 && checkmark {
checkwbshadow((*uintptr)(unsafe.Pointer(b + i)))
}
// bitMarked bit that is not set then we throw.
//go:nowritebarrier
func gccheckmark_m(startTime int64, eagersweep bool) {
- if !gccheckmarkenable {
+ if debug.gccheckmark == 0 {
return
}
gc_m(startTime, eagersweep) // turns off checkmark + calls clearcheckmarkbits
}
-//go:nowritebarrier
-func gccheckmarkenable_m() {
- gccheckmarkenable = true
-}
-
-//go:nowritebarrier
-func gccheckmarkdisable_m() {
- gccheckmarkenable = false
-}
-
//go:nowritebarrier
func finishsweep_m() {
// The world is stopped so we should be able to complete the sweeps
}
if !checkmark {
+ // TODO(austin) This is a noop beceause we should
+ // already have swept everything to the current
+ // sweepgen.
finishsweep_m() // skip during checkmark debug phase.
}
sysFree(unsafe.Pointer(&work.spans[0]), uintptr(len(work.spans))*unsafe.Sizeof(work.spans[0]), &memstats.other_sys)
}
- if gccheckmarkenable {
+ if debug.gccheckmark > 0 {
if !checkmark {
// first half of two-pass; don't set up sweep
unlock(&mheap_.lock)
scheddetail int32
schedtrace int32
wbshadow int32
+ gccheckmark int32
}
var dbgvars = []dbgVar{
{"scheddetail", &debug.scheddetail},
{"schedtrace", &debug.schedtrace},
{"wbshadow", &debug.wbshadow},
+ {"gccheckmark", &debug.gccheckmark},
}
func parsedebugvars() {
+ // gccheckmark is enabled by default for the 1.5 dev cycle
+ debug.gccheckmark = 1
+
for p := gogetenv("GODEBUG"); p != ""; {
field := ""
i := index(p, ",")