kernel - Refactor cpu localization for VM page allocations (3)v4.6.0
commit4161f66d193c22aaa9e8714572d118897ec4062c
authorMatthew Dillon <dillon@apollo.backplane.com>
Sun, 31 Jul 2016 03:40:06 +0000 (30 20:40 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sun, 31 Jul 2016 07:02:50 +0000 (31 00:02 -0700)
tree8c5e15d5bebcbf165feccfa472e2548d7b4ba30f
parentcede4056848b741110ec3f00a73c7b194e7869e0
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