git: kernel - Revamp LWKT thread migration

Matthew Dillon dillon at crater.dragonflybsd.org
Thu Mar 24 14:46:22 PDT 2011


commit cc9b6223b2987bd6f07ca869665f420285917156
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Thu Mar 24 14:40:08 2011 -0700

    kernel - Revamp LWKT thread migration
    
    * Rearrange the handling of TDF_RUNNING, making lwkt_switch() responsible
      for it instead of the assembly switch code.  Adjust td->td_switch() to
      return the previously running thread.
    
      This allows lwkt_switch() to process thread migration between cpus after
      the thread has been completely and utterly switched out, removing the
      need to loop on TDF_RUNNING on the target cpu.
    
    * Fixes lwkt_setcpu_remote livelock failure
    
    * This required major surgery on the core thread switch assembly, testing
      is needed.  I tried to avoid doing this but the livelock problems persisted,
      so the only solution was to remove the need for the loops that were causing
      the livelocks.
    
    * NOTE: The user process scheduler is still using the old giveaway/acquire
    	method.  More work is needed here.
    
    Reported-by: "Magliano Andre'" <masterblaster at tiscali.it>

Summary of changes:
 sys/kern/lwkt_thread.c                     |  135 +++++++++++++++++++--------
 sys/kern/usched_bsd4.c                     |    4 +
 sys/platform/pc32/i386/exception.s         |   12 +++
 sys/platform/pc32/i386/swtch.s             |   75 ++++++++++------
 sys/platform/pc32/include/md_var.h         |    7 ++-
 sys/platform/pc64/include/md_var.h         |    2 +-
 sys/platform/pc64/x86_64/exception.S       |   11 +++
 sys/platform/pc64/x86_64/swtch.s           |   78 ++++++++++------
 sys/platform/vkernel/i386/fork_tramp.s     |   12 +++
 sys/platform/vkernel/i386/swtch.s          |   76 ++++++++++------
 sys/platform/vkernel/include/md_var.h      |    2 +-
 sys/platform/vkernel64/include/md_var.h    |    2 +-
 sys/platform/vkernel64/x86_64/fork_tramp.s |   11 +++
 sys/platform/vkernel64/x86_64/swtch.s      |   85 +++++++++++-------
 sys/sys/proc.h                             |    4 +-
 sys/sys/thread.h                           |    4 +-
 16 files changed, 352 insertions(+), 168 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/cc9b6223b2987bd6f07ca869665f420285917156


-- 
DragonFly BSD source repository





More information about the Commits mailing list