kernel - Refactor cpu localization for VM page allocations (3)
authorMatthew Dillon <dillon@apollo.backplane.com>
Sun, 31 Jul 2016 03:40:06 +0000 (20:40 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sun, 31 Jul 2016 06:59:58 +0000 (23:59 -0700)
commitdbe024715327421fcd372f33375d9dc83ded59db
tree86b65db3dfe7ff1200d8812676a0ea594758a125
parentd11dcf6adbe99ce3eb4e7de76aa6810b7c44cd2c
kernel - Refactor cpu localization for VM page allocations (3)

* Instead of iterating the cpus in the mask starting at cpu #0, iterate
  starting at mycpu to the end, then from 0 to mycpu - 1.

  This fixes random masked wakeups from favoring lower-numbered cpus.

* The user process scheduler (usched_dfly) was favoring lower-numbered
  cpus due to a bug in the simple selection algorithm, causing forked
  processes to initially weight improperly.  A high fork or fork/exec
  rate skewed the way the cpus were loaded.

  Fix this by correctly scanning cpus from the (scancpu) rover.

* For now, use a random 'previous' affinity for initially scheduling a
  fork.
sys/cpu/x86_64/include/cpumask.h
sys/kern/lwkt_ipiq.c
sys/kern/usched_dfly.c
sys/vm/vm_zeroidle.c