Subject: PR/35932 CVS commit: src/sys
To: None <ad@NetBSD.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org,>
From: Andrew Doran <ad@netbsd.org>
List: netbsd-bugs
Date: 03/21/2007 18:30:03
The following reply was made to PR kern/35932; it has been noted by GNATS.
From: Andrew Doran <ad@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc:
Subject: PR/35932 CVS commit: src/sys
Date: Wed, 21 Mar 2007 18:26:01 +0000 (UTC)
Module Name: src
Committed By: ad
Date: Wed Mar 21 18:26:00 UTC 2007
Modified Files:
src/sys/kern: kern_exit.c kern_lwp.c sys_lwp.c
src/sys/sys: lwp.h
Log Message:
Improvements to lwp_wait1(), for PR kern/35932:
- Better detect simple cycles of threads calling _lwp_wait and return
EDEADLK. Does not handle deeper cycles like t1 -> t2 -> t3 -> t1.
- If there are multiple threads in _lwp_wait, then make sure that
targeted waits take precedence over waits for any LWP to exit.
- When checking for deadlock, also count the number of zombies currently
in the process as potentially reapable. Whenever a zombie is murdered,
kick all waiters to make them check again for deadlock.
- Add more comments.
Also, while here:
- LOCK_ASSERT -> KASSERT in some places
- lwp_free: change boolean arguments to type 'bool'.
- proc_free: let lwp_free spin waiting for the last LWP to exit, there's
no reason to do it here.
To generate a diff of this commit:
cvs rdiff -r1.171 -r1.172 src/sys/kern/kern_exit.c
cvs rdiff -r1.62 -r1.63 src/sys/kern/kern_lwp.c
cvs rdiff -r1.16 -r1.17 src/sys/kern/sys_lwp.c
cvs rdiff -r1.56 -r1.57 src/sys/sys/lwp.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.