• Rick Hudson's avatar
    runtime: run background mark helpers only if work is available · 913db768
    Rick Hudson authored
    Prior to this CL whenever the GC marking was enabled and
    a P was looking for work we supplied a G to help
    the GC do its marking tasks. Once this G finished all
    the marking available it would release the P to find another
    available G. In the case where there was no work the P would drop
    into findrunnable which would execute the mark helper G which would
    immediately return and the P would drop into findrunnable again repeating
    the process. Since the P was always given a G to run it never blocks.
    This CL first checks if the GC mark helper G has available work and if
    not the P immediately falls through to its blocking logic.
    
    Fixes #10901
    
    Change-Id: I94ac9646866ba64b7892af358888bc9950de23b5
    Reviewed-on: https://go-review.googlesource.com/10189Reviewed-by: default avatarAustin Clements <austin@google.com>
    913db768
mgc.go 49.3 KB