]> Cypherpunks repositories - gostls13.git/commit
runtime: start dedicated mark workers even if there's no work
authorAustin Clements <austin@google.com>
Thu, 23 Apr 2015 23:51:03 +0000 (19:51 -0400)
committerAustin Clements <austin@google.com>
Fri, 24 Apr 2015 20:10:05 +0000 (20:10 +0000)
commit26eac917dca240b318685ac019e606d02e79e600
treed3c076c2ba6aebe29d1132898f18e25b93c1a892
parent711a1642679ee0beac7501902c6f400946361171
runtime: start dedicated mark workers even if there's no work

Currently, findRunnable only considers running a mark worker if
there's work in the work queue. In principle, this can delay the start
of the desired number of dedicated mark workers if there's no work
pending. This is unlikely to occur in practice, since there should be
work queued from the scan phase, but if it were to come up, a CPU hog
mutator could slow down or delay garbage collection.

This check makes sense for fractional mark workers, since they'll just
return to the scheduler immediately if there's no work, but we want
the scheduler to start all of the dedicated mark workers promptly,
even if there's currently no queued work. Hence, this change moves the
pending work check after the check for starting a dedicated worker.

Change-Id: I52b851cc9e41f508a0955b3f905ca80f109ea101
Reviewed-on: https://go-review.googlesource.com/9298
Reviewed-by: Rick Hudson <rlh@golang.org>
src/runtime/mgc.go