From owner-freebsd-arch@FreeBSD.ORG Thu Feb 22 21:39:09 2007 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8F74D16A403 for ; Thu, 22 Feb 2007 21:39:09 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.freebsd.org (Postfix) with ESMTP id 63AC413C428 for ; Thu, 22 Feb 2007 21:39:07 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.8/8.13.8) with ESMTP id l1MLcjZL005840; Thu, 22 Feb 2007 16:38:48 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: LI Xin Date: Thu, 22 Feb 2007 16:39:12 -0500 User-Agent: KMail/1.9.1 References: <45CC0EB9.7030400@delphij.net> <200702090837.04495.jhb@freebsd.org> <45DDD816.80303@delphij.net> In-Reply-To: <45DDD816.80303@delphij.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200702221639.12751.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Thu, 22 Feb 2007 16:38:49 -0500 (EST) X-Virus-Scanned: ClamAV 0.88.3/2630/Thu Feb 22 14:12:40 2007 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: freebsd-arch@freebsd.org Subject: Re: Patch for review: resolve a race condition in [sg]etpriority() X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Feb 2007 21:39:09 -0000 On Thursday 22 February 2007 12:51, LI Xin wrote: > Hi, John, > > John Baldwin wrote: > > My only reason for favoring the wakeup for complete initialization is that > > while this patch may solve the getprio/setprio race, it doesn't solve all > > PRS_NEW-related races, which the sleep/wakeup proposal did. > > Today I have some time and tried your approach for a second time. It > looks like that we can not simply sleep with allproc_lock held. The > attached patchset implements the proof-of-concept idea, please let me > know if you think this one is better. Ok. It would actually be really nice if we could not put the process onto the allproc list until it was really fully created. Is the only reason we put it on the list to prevent duplicate pid allocation? -- John Baldwin