aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/testdata/testprog/schedmetrics.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/runtime/testdata/testprog/schedmetrics.go b/src/runtime/testdata/testprog/schedmetrics.go
index 8e8abc4484..7fad95a976 100644
--- a/src/runtime/testdata/testprog/schedmetrics.go
+++ b/src/runtime/testdata/testprog/schedmetrics.go
@@ -91,8 +91,10 @@ func SchedMetrics() {
// threads through frequent scheduling, like mayMoreStackPreempt.
// A slack of 5 is arbitrary but appears to be enough to cover
// the leftovers plus any inflation from scheduling-heavy build
- // modes.
- const threadsSlack = 5
+ // modes. We then also add initialGMP to this slack, since we're
+ // about to call runtime.GC, and in the worst case this will
+ // spin up GOMAXPROCS new threads to run those workers.
+ threadsSlack := 5 + uint64(initialGMP)
// Make sure GC isn't running, since GC workers interfere with
// expected counts.