From owner-freebsd-arch Fri Feb 22 11:41: 0 2002 Delivered-To: freebsd-arch@freebsd.org Received: from rwcrmhc54.attbi.com (rwcrmhc54.attbi.com [216.148.227.87]) by hub.freebsd.org (Postfix) with ESMTP id 3108037B429; Fri, 22 Feb 2002 11:40:11 -0800 (PST) Received: from InterJet.elischer.org ([12.232.206.8]) by rwcrmhc54.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20020222194011.CYAN1214.rwcrmhc54.attbi.com@InterJet.elischer.org>; Fri, 22 Feb 2002 19:40:11 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id LAA74419; Fri, 22 Feb 2002 11:34:49 -0800 (PST) Date: Fri, 22 Feb 2002 11:34:48 -0800 (PST) From: Julian Elischer To: Matthew Dillon Cc: John Baldwin , arch@FreeBSD.ORG Subject: Re: RE: that INVARIANT/ucred freeing stuff. In-Reply-To: <200202221929.g1MJTFI20465@apollo.backplane.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, 22 Feb 2002, Matthew Dillon wrote: > Sigh. Well, if you really want. I don't like the idea of > the size of the thread structure changing just due to someone > turning on or off DIAGNOSTIC though. > I'LL JUST THROW IN A DUMMY (Geez, bloody capslock).. > -Matt > > :OK here is my suggestion: > : > :We add extra code under DIAGNOSTIC > :the code does: > : > :in proc.h > : > :add a field to thread of: > :#ifdef DIAGNOSTIC > : td_ucred_cache > :#endif /* DIAGNOSTIC */ > : > : > :on texiting the kernel: > : > :#ifdef DIAGNOSTIC > : if (td->td_ucred_cache) > : panic("thread already has cached ucred"); > : td->td_ucred_cache = td->td_ucred; > : td->td_ucred = NULL; > :#endif /* DIAGNOSTIC */ > : > : > :on entering the kernel we do: > : > : > :#ifdef DIAGNOSTIC > : if (td->td_ucred) > : panic("thread got a cred form somewhere in userspace"); > : td->td_cred = td->td_ucred_cache; > : td->td_ucred_cache = NULL; > :#endif /* DIAGNOSTIC */ > : if (td->ucred != p->p_ucred) > : cred_update_thread(td); > : > :we get good performance even when it it is optionned in and > :still have a NULL ucred pointer when in user space when DIAGNOSTIC > :is turned on. With no DIAGNOSTICS we get the best performance, > :and don't even bother to shift the reference. > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-arch" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message