]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
epoch(9): fix priority handling, make callback lists pcpu, and other fixes
authormmacy <mmacy@FreeBSD.org>
Fri, 11 May 2018 04:54:12 +0000 (04:54 +0000)
committermmacy <mmacy@FreeBSD.org>
Fri, 11 May 2018 04:54:12 +0000 (04:54 +0000)
commit73d042eb349436b777b948a5e4b537a07c28748d
tree419b6cd4eb80a93c54173d7c18ca0e219c9426fb
parent2076e8aba553a0f8bb499803f8bd206113e79033
epoch(9): fix priority handling, make callback lists pcpu, and other fixes

- Lend priority to preempted threads in epoch_wait to handle the case
  in which we've had priority lent to us. Previously we borrowed the
  priority of the lowest priority preempted thread. (pointed out by mjg@)

- Don't attempt allocate memory per-domain on powerpc, we don't currently
  handle empty sockets (as is the case on jhibbits Talos' board).

- Handle deferred callbacks as pcpu lists and poll the lists periodically.
  Currently the interval is 1/hz.

- Drop the thread lock when adaptive spinning. Holding the lock starves
  other threads and can even lead to lockups.

- Keep a generation count pcpu so that we don't keep spining if a thread
  has left and re-entered an epoch section.

- Actually removed the callback from the callback list so that we don't
  double free. Sigh ...

Approved by: sbruno@
sys/kern/subr_epoch.c