From owner-freebsd-current Sat Feb 9 7:51:27 2002 Delivered-To: freebsd-current@freebsd.org Received: from mail12.speakeasy.net (mail12.speakeasy.net [216.254.0.212]) by hub.freebsd.org (Postfix) with ESMTP id C803F37B41F for ; Sat, 9 Feb 2002 07:50:47 -0800 (PST) Received: (qmail 14900 invoked from network); 9 Feb 2002 15:50:46 -0000 Received: from unknown (HELO laptop.baldwin.cx) ([65.91.153.195]) (envelope-sender ) by mail12.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 9 Feb 2002 15:50:46 -0000 Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: Date: Sat, 09 Feb 2002 10:50:45 -0500 (EST) From: John Baldwin To: Julian Elischer Subject: RE: cred stuff.. Cc: current@freebsd.org 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 09-Feb-02 Julian Elischer wrote: > > > On Fri, 8 Feb 2002, Julian Elischer wrote: > >> John, (peter? others?) >> >> How is it that getting a ucred reference is guarded by PROC_LOCK(p) >> but freeing it is guarded by mtx_lock(&Giant); >> ? >> >> Call me naive, but shouldn't they be guarded by the same thing? > > In fact, if we had good atomic reference counting primatives, > couldn't we just forget the locks entirely for this? We had a long bikeshed about that a while back but people complained that refcount_t wasn't generic enough, although it is well-suited to this specific instance. We can always come back and optimize the ucred mutex later, but there are really more important things to be doing at this point. :) It works for now, Giant is a much bigger problem that the ucred mutex. >> Julian >> >> >> On Fri, 8 Feb 2002, Julian Elischer wrote: >> >> > I'm a little worried about invariants because the behaviour when >> > INVARIANTS is set wil be different to teh behaviour when it is off, which >> > is 'strange' to say the least. Normally the behaviour si the same but you >> > just check for invariant conditions. >> > >> > >> > On Fri, 8 Feb 2002, John Baldwin wrote: >> > >> > > >> > > On 08-Feb-02 Julian Elischer wrote: >> > > > >> > > > I'd like to commit the code to keep the ucred across userland, >> > > > with the code to clear it to NULL kept under DEBUG ifdefs. >> > > >> > > Use INVARIANTS for the ifdef macro name, but sure. >> > > >> > > -- >> > > >> > > 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 >> > -- 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