• Austin Clements's avatar
    runtime: start dedicated mark workers even if there's no work · 26eac917
    Austin Clements authored
    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/9298Reviewed-by: default avatarRick Hudson <rlh@golang.org>
    26eac917
mgc.go 49.5 KB