DragonFly BSD
DragonFly commits List (threaded) for 2011-11
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

git: kernel - Fix ps/thread-exit and other related ps races


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 17 Nov 2011 09:20:55 -0800 (PST)

commit eb2adbf513fa1db03b9e8e7b61fcaf511babd367
Author: Matthew Dillon <dillon@apollo.backplane.com>
Date:   Thu Nov 17 09:04:53 2011 -0800

    kernel - Fix ps/thread-exit and other related ps races
    
    * Adjust sysctl_kern_proc()'s kernel thread scanning code to use a marker
      instead of depending on td remaining on its proper list.  Otherwise
      blocking conditions can rip td out from under us or move it to another
      cpu, potentially resulting in a crash or livelock.  Index the scan
      backwards to avoid live-locking continuous adds to the list.
    
    * Fix a potential race is the zombie removal code vs a ps, p->p_token was
      being released too early.
    
    * Adjust lwkt_exit() to wait for the thread's hold count to drop to zero
      so lwkt_hold() works as advertised.

Summary of changes:
 sys/ddb/db_ps.c        |    2 +
 sys/kern/kern_exit.c   |    3 +-
 sys/kern/kern_proc.c   |   76 +++++++++++++++++++++++++++++++++++++++++-------
 sys/kern/lwkt_thread.c |   11 +++++++
 sys/sys/thread.h       |    2 +-
 5 files changed, 81 insertions(+), 13 deletions(-)

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


-- 
DragonFly BSD source repository



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]