From owner-cvs-src@FreeBSD.ORG Sat Oct 9 04:33:02 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8CFF716A4CE; Sat, 9 Oct 2004 04:33:02 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 810B243D45; Sat, 9 Oct 2004 04:33:02 +0000 (GMT) (envelope-from julian@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i994X2no057182; Sat, 9 Oct 2004 04:33:02 GMT (envelope-from julian@repoman.freebsd.org) Received: (from julian@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i994X203057181; Sat, 9 Oct 2004 04:33:02 GMT (envelope-from julian) Message-Id: <200410090433.i994X203057181@repoman.freebsd.org> From: Julian Elischer Date: Sat, 9 Oct 2004 04:33:02 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: RELENG_5 Subject: cvs commit: src/sys/sys proc.h src/sys/kern kern_exec.c kern_thread.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2004 04:33:02 -0000 julian 2004-10-09 04:33:02 UTC FreeBSD src repository Modified files: (Branch: RELENG_5) sys/sys proc.h sys/kern kern_exec.c kern_thread.c Log: MFC: 1.254 +46 -12 src/sys/kern/kern_exec.c 1.203 +60 -23 src/sys/kern/kern_thread.c 1.409 +5 -3 src/sys/sys/proc.h In original kern_execve() code, at the start of the function, it forces all other threads to suicide, problem is execve() could be failed, and a failed execve() would change threaded process to unthreaded, this side effect is unexpected. The new code introduces a new single threading mode SINGLE_BOUNDARY, in the mode, all threads should suspend themself at user boundary except the singler. we can not use SINGLE_NO_EXIT because we want to start from a clean state if execve() is successful, suspending other threads at unknown point and later resuming them from there and forcing them to exit at user boundary may cause the process to start from a dirty state. If execve() is successful, current thread upgrades to SINGLE_EXIT mode and forces other threads to suicide at user boundary, otherwise, other threads will be resumed and their interrupted syscall will be restarted. Submitted by: davidxu Approved by: re (scottl) Revision Changes Path 1.249.2.2 +46 -13 src/sys/kern/kern_exec.c 1.193.2.6 +61 -24 src/sys/kern/kern_thread.c 1.392.2.10 +5 -3 src/sys/sys/proc.h