From owner-cvs-all@FreeBSD.ORG Thu Oct 25 05:23:02 2007 Return-Path: Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE99D16A46C for ; Thu, 25 Oct 2007 05:23:02 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outY.internet-mail-service.net (outY.internet-mail-service.net [216.240.47.248]) by mx1.freebsd.org (Postfix) with ESMTP id C267F13C4A6 for ; Thu, 25 Oct 2007 05:23:02 +0000 (UTC) (envelope-from julian@elischer.org) Received: from mx0.idiom.com (HELO idiom.com) (216.240.32.160) by out.internet-mail-service.net (qpsmtpd/0.40) with ESMTP; Wed, 24 Oct 2007 22:23:02 -0700 X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id 410611267E0; Wed, 24 Oct 2007 22:23:01 -0700 (PDT) Message-ID: <47202850.7050802@elischer.org> Date: Wed, 24 Oct 2007 22:23:28 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: Alfred Perlstein References: <200710231754.l9NHsGLH090312@repoman.freebsd.org> <471FF2BE.9000204@freebsd.org> <20071025022607.GQ33488@elvis.mu.org> In-Reply-To: <20071025022607.GQ33488@elvis.mu.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, Julian Elischer , David Xu , cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern kern_fork.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Oct 2007 05:23:03 -0000 Alfred Perlstein wrote: > * David Xu [071024 18:34] wrote: >> Julian Elischer wrote: >>> julian 2007-10-23 17:54:16 UTC >>> >>> FreeBSD src repository >>> >>> Modified files: >>> sys/kern kern_fork.c >>> Log: >>> Take out the single-threading code in fork. >>> After discussions with jeff, alc, (various Ironport people), david Xu, >>> and mostly Alfred (who found the problem) it has been demonstrated that >>> this >>> is not needed for our implementations of threads and represents a real >>> (as in we've seen it happen a lot) deadlock danger. >>> ... >> I think if process is forking a thread, that says flag RFPROC is not >> set and flags RFCFDG or RFCFDG is set, you still need to call >> thread_single(SINGLE_BOUNDARY), otherwise, for a threaded process, >> the memory pointed by p_fd is freed while other threads are using it, >> it will cause kernel to panic. > > This is unlikely to be fixed by SINGLE_BOUNDARY and will likely require > refcounting to fix. SINGLE_BOUNDARY will not fix the locations where > this happens: > > p = td->td_proc; > fdp = p->p_fd; > do something that blocks... > re-use fdp. the SINGLE_BOUNDARY wouldn't let this happen, as all threads would have to be at the user boundary to be conformant and they can not have such references there. I'm not convinced however that it is fully functional at this time however. A quick read-through to see what it was doing gave me a headache.