From owner-cvs-all Mon Oct 14 17:14:34 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 74CD937B401; Mon, 14 Oct 2002 17:14:33 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 358E643EAF; Mon, 14 Oct 2002 17:14:33 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id g9F0EXMt000883; Mon, 14 Oct 2002 17:14:33 -0700 (PDT) (envelope-from jhb@repoman.freebsd.org) Received: (from jhb@localhost) by repoman.freebsd.org (8.12.6/8.12.3/Submit) id g9F0EWcx000882; Mon, 14 Oct 2002 17:14:32 -0700 (PDT) Message-Id: <200210150014.g9F0EWcx000882@repoman.freebsd.org> From: John Baldwin Date: Mon, 14 Oct 2002 17:14:32 -0700 (PDT) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/kern kern_exit.c kern_fork.c kern_proc.c src/sys/sys proc.h X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG jhb 2002/10/14 17:14:32 PDT Modified files: sys/kern kern_exit.c kern_fork.c kern_proc.c sys/sys proc.h Log: - Add a new global mutex 'ppeers_lock' to protect the p_peers list of processes forked with RFTHREAD. - Use a goto to a label for common code when exiting from fork1() in case of an error. - Move the RFTHREAD linkage setup code later in fork since the ppeers_lock cannot be locked while holding a proc lock. Handle the race of a task leader exiting and killing its peers while a peer is forking a new child. In that case, go ahead and let the peer process proceed normally as the parent is about to kill it. However, the task leader may have already gone to sleep to wait for the peers to die, so the new child process may not receive a SIGKILL from the task leader. Rather than try to destruct the new child process, just go ahead and send it a SIGKILL directly and add it to the p_peers list. This ensures that the task leader will wait until both the peer process doing the fork() and the new child process have received their KILL signals and exited. Discussed with: truckman (earlier versions) Revision Changes Path 1.184 +6 -6 src/sys/kern/kern_exit.c 1.171 +50 -38 src/sys/kern/kern_fork.c 1.162 +2 -0 src/sys/kern/kern_proc.c 1.271 +3 -1 src/sys/sys/proc.h To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message