git: kernel - Refactor cpu localization for VM page allocations (3)

Matthew Dillon dillon at
Sun Jul 31 00:00:11 PDT 2016

commit dbe024715327421fcd372f33375d9dc83ded59db
Author: Matthew Dillon <dillon at>
Date:   Sat Jul 30 20:40:06 2016 -0700

    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

Summary of changes:
 sys/cpu/x86_64/include/cpumask.h |  7 +++
 sys/kern/lwkt_ipiq.c             | 31 +++++++++++--
 sys/kern/usched_dfly.c           | 99 +++++++++++++++++++++++++++-------------
 sys/vm/vm_zeroidle.c             | 10 +---
 4 files changed, 105 insertions(+), 42 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list