Re: git: kernel: Don't disturb about-to-be reaped zombies.

看板DFBSD_commit作者時間14年前 (2011/05/29 17:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串3/4 (看更多)
On Sat, May 28, 2011 at 11:14:56AM -0700, Matthew Dillon wrote: > > :commit 9458c398c0b97d30032a6541f8ab452cd93f5a86 > :Author: YONETANI Tomokazu <y0netan1@dragonflybsd.org> > :Date: Fri May 27 22:27:39 2011 +0900 > : > : kernel: Don't disturb about-to-be reaped zombies. > : > : Processes in zombproc with p_nthreads == 0 are about to be reaped, > : so just leave them in peace. > : > : Dragonfly-bug: <http://bugs.dragonflybsd.org/issue1996> : > I'm not sure about that. nthreads == 0 should just mean that the > process's threads have all exited, not that the zombie process is > about to be reaped by a wait*() call. It will probably be reaped > soon, but not necessarily... it depends on when the user process > actually calls wait*(). > > What we might have to do instead is add another process flag, say > PREAPING, which would be set in kern_wait() somewhere around line > 838 (just after it gets p->p_token). Even then we might want it > to show up in the ps in case it gets stuck during the exit, so it > isn't an invisible stuck process. Adding the process flag and using it is easy. But to make those processes show up in the ps with P_REAPING set, you need to let sysctl_kern_proc() call sysctl_out_proc(p) on them while holding p->p_lock, which eventually breaks the assertion on kern_exit.c:901 (KKASSERT(p->p_lock == 0)). So, back to the original question in issue1996 (well, actually I asked that in the second post, not the first one :), can we simply drop this assertion (and let proc_remove_zombie() wait for p->p_lock to drop)? Best Regards, YONETANI Tomokazu.
文章代碼(AID): #1DuXANqL (DFBSD_commit)
文章代碼(AID): #1DuXANqL (DFBSD_commit)