• Austin Clements's avatar
    runtime: parallelize STW mcache flushing · a475a38a
    Austin Clements authored
    Currently all mcaches are flushed in a single STW root job. This takes
    about 5 µs per P, but since it's done sequentially it adds about
    5*GOMAXPROCS µs to the STW.
    
    Fix this by parallelizing the job. Since there are exactly GOMAXPROCS
    mcaches to flush, this parallelizes quite nicely and brings the STW
    latency cost down to a constant 5 µs (assuming GOMAXPROCS actually
    reflects the number of CPUs).
    
    Updates #17503.
    
    Change-Id: Ibefeb1c2229975d5137c6e67fac3b6c92103742d
    Reviewed-on: https://go-review.googlesource.com/32033Reviewed-by: 's avatarRick Hudson <rlh@golang.org>
    a475a38a
mstats.go 21.7 KB