git: kernel - Fix stalls during major token contention
Matthew Dillon
dillon at crater.dragonflybsd.org
Sat Jul 9 22:37:42 PDT 2016
commit 844cfcd65d13ec68f98e077f96bd9307f4a5b969
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date: Sat Jul 9 22:24:06 2016 -0700
kernel - Fix stalls during major token contention
* When a set of processes is seriously contending on a token, unrelated
lower-priority processes scheduled to the same cpu may stall randomly for
several seconds at a time. Such contention is rare, but can still occur
at choke-points (such as multiple threads write-faulting on the same VM
object) and result in a degenerate condition.
This occurs because the scheduler has become fixated on the contending
thread due to its priority. Because the 'current thread' might not be the
one that is contending, the scheduler clock does not account for the
contending thread.
* Add a contention heuristic to the scheduler for now which releases the
contending thread on the current cpu (allowing the userland scheduler to
choose another thread to schedule).
* At the moment I have not tried to code the scheduler clock to account for
the contending thread. Theoretically doing so would reduce its dynamic
priority so the scheduler does not fixate on it, but it is a bit of a
round-about way to solve the problem whereas coding it in lwkt_switch()
gives us nearly instant detection.
Summary of changes:
sys/kern/lwkt_thread.c | 31 +++++++++++++++++++++----------
1 file changed, 21 insertions(+), 10 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/844cfcd65d13ec68f98e077f96bd9307f4a5b969
--
DragonFly BSD source repository
More information about the Commits
mailing list