git: kernel - Add usched_dfly algorith, set as default for now (3)

Matthew Dillon dillon at
Tue Sep 18 11:09:43 PDT 2012

commit c75e41b70db3548a580791be81447d2d22e74aaf
Author: Matthew Dillon <dillon at>
Date:   Tue Sep 18 11:01:35 2012 -0700

    kernel - Add usched_dfly algorith, set as default for now (3)
    * Add a field to the thread structure, td_wakefromcpu.  All wakeup()
      family calls will load this field with the cpu the thread was woken
      up FROM.
    * Use this field in usched_dfly to weight scheduling such that pairs
      of synchronously-dependent threads (for example, a pgbench thread
      and a postgres server process) are placed closer to each other in
      the cpu topology.
    * Weighting:
      - Load matters the most
      - Current cpu thread is scheduled on is next
      - Synchronous wait/wakeup weighting is last
    * Tests on monster yield better all-around results with a new all-time
      high w/ pgbench -j 40 -c 40 -T 60 -S bench:
      25% idle at 40:40 tps = 215293.173300 (excluding connections establishing)
      Without the wait/wakeup weighting (but with allwload and current cpu
      41% idle at 40:40 tps = 162352.813046 (excluding connections establishing)
      Without wait/wakeup or current-cpu weighting.  Load balancing only:
      43% idle at 40:40 tps = 159047.440641 (excluding connections establishing)

Summary of changes:
 sys/kern/kern_synch.c  |   33 ++++++++++++++++------
 sys/kern/usched_dfly.c |   71 +++++++++++++++++++++++++++++-------------------
 sys/sys/thread.h       |    3 +-
 3 files changed, 69 insertions(+), 38 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list