From owner-freebsd-arch@FreeBSD.ORG Thu Feb 22 22:05:35 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 10BFF16A400; Thu, 22 Feb 2007 22:05:35 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [210.51.165.229]) by mx1.freebsd.org (Postfix) with ESMTP id B68B513C4AC; Thu, 22 Feb 2007 22:05:34 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from localhost (tarsier.geekcn.org [210.51.165.229]) by tarsier.geekcn.org (Postfix) with ESMTP id C70E4EB5C15; Fri, 23 Feb 2007 06:05:33 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([210.51.165.229]) by localhost (mail.geekcn.org [210.51.165.229]) (amavisd-new, port 10024) with ESMTP id FbB7Eb3SZO3s; Fri, 23 Feb 2007 06:05:27 +0800 (CST) Received: from [192.168.1.32] (unknown [61.51.106.205]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTP id 0C39EEB5C0F; Fri, 23 Feb 2007 06:05:27 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:organization:user-agent:mime-version:to:cc: subject:references:in-reply-to:x-enigmail-version:content-type:content-transfer-encoding; b=HVluQfmQQ1SCr3AhjvG09t98QDtd6AhnW1hTlf86wLhDIUk5s1q2d8VT+pFJzK/LU ZG3nn1ZNgWLAbC9r4b+3g== Message-ID: <45DE13A6.4010509@delphij.net> Date: Fri, 23 Feb 2007 06:05:26 +0800 From: LI Xin Organization: The FreeBSD Project User-Agent: Thunderbird 1.5.0.9 (Macintosh/20061207) MIME-Version: 1.0 To: John Baldwin References: <45CC0EB9.7030400@delphij.net> <200702090837.04495.jhb@freebsd.org> <45DDD816.80303@delphij.net> <200702221639.12751.jhb@freebsd.org> In-Reply-To: <200702221639.12751.jhb@freebsd.org> X-Enigmail-Version: 0.94.1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit 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 22:05:35 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 John Baldwin wrote: > 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? For allproc insertion, I think the insert operation itself stands for avoiding duplication only, but the lock have more side effects. Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFF3hOmOfuToMruuMARCmZPAJ9bfQjkwxZHJCH+mrPIytQcnumMXACeLIbX ETesrVoocE3srTogqYBYiyU= =oX7K -----END PGP SIGNATURE-----