• Austin Clements's avatar
    runtime: schedule fractional workers on all Ps · e09dbaa1
    Austin Clements authored
    Currently only a single P can run a fractional mark worker at a time.
    This doesn't let us spread out the load, so it gets concentrated on
    whatever unlucky P picks up the token to run a fractional worker. This
    can significantly delay goroutines on that P.
    
    This commit changes this scheduling rule so each P separately
    schedules fractional workers. This can significantly reduce the load
    on any individual P and allows workers to self-preempt earlier. It
    does have the downside that it's possible for all Ps to be in
    fractional workers simultaneously (an effect STW).
    
    Updates #21698.
    
    Change-Id: Ia1e300c422043fa62bb4e3dd23c6232d81e4419c
    Reviewed-on: https://go-review.googlesource.com/68574
    Run-TryBot: Austin Clements <austin@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarRick Hudson <rlh@golang.org>
    e09dbaa1
runtime2.go 26.7 KB