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

看板DFBSD_commit作者時間14年前 (2011/11/18 02:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
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
文章代碼(AID): #1EnKlpk1 (DFBSD_commit)