]> Cypherpunks repositories - gostls13.git/commit
runtime: schedule fractional workers on all Ps
authorAustin Clements <austin@google.com>
Thu, 5 Oct 2017 16:16:45 +0000 (12:16 -0400)
committerAustin Clements <austin@google.com>
Fri, 13 Oct 2017 20:53:22 +0000 (20:53 +0000)
commite09dbaa1de2e323d35a6b8c2617fc0c4ae0505f8
tree70abff1337fec99c0f66eb135691b1672cc869f2
parent28e1a8e47aa089e781aa15bdd16e15265a5180bd
runtime: schedule fractional workers on all Ps

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: Rick Hudson <rlh@golang.org>
src/runtime/mgc.go
src/runtime/runtime2.go