From owner-freebsd-current Mon Feb 11 19:36:10 2002 Delivered-To: freebsd-current@freebsd.org Received: from newman2.bestweb.net (newman2.bestweb.net [209.94.102.67]) by hub.freebsd.org (Postfix) with ESMTP id 2AF3937B683; Mon, 11 Feb 2002 18:19:27 -0800 (PST) Received: from okeeffe.bestweb.net (okeefe.bestweb.net [209.94.100.110]) by newman2.bestweb.net (Postfix) with ESMTP id 08F2D23212; Mon, 11 Feb 2002 21:18:20 -0500 (EST) Received: by okeeffe.bestweb.net (Postfix, from userid 0) id E6F099F415; Mon, 11 Feb 2002 21:12:52 -0500 (EST) Date: Mon, 11 Feb 2002 20:44:07 -0500 (EST) From: John Baldwin To: Julian Elischer Subject: Re: ucred holding patch, BDE version Cc: current@freebsd.org, bde@freebsd.org, Message-Id: <20020212021252.E6F099F415@okeeffe.bestweb.net> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 12-Feb-02 Julian Elischer wrote: > The proclock is needed to get the reference, > guarding against other threads, and giant is needed fo rnot to free it > because if it reaches a refcount of 0 it needs to call free(). (which john > assures me needs Giant at this time). > We could avoid the proclock with judicious use of an atomic refcount > incrementing method. _No_! The proc lock is protecting p_ucred, it can't go away! What _can_ go away is the per-ucred mutex to protect the refcount if we ever revive the refcount API. > When Giant goes away it won't be so bad but it will STILL be quicker to > not drop it across userland. Yes. Actually, calling free() can still be rather expensive even when Giant is gone. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message