From owner-cvs-all Sat Feb 23 16:46:42 2002 Delivered-To: cvs-all@freebsd.org Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by hub.freebsd.org (Postfix) with ESMTP id 05D0537B402; Sat, 23 Feb 2002 16:46:38 -0800 (PST) Received: by elvis.mu.org (Postfix, from userid 1192) id D1BB9AE303; Sat, 23 Feb 2002 16:46:37 -0800 (PST) Date: Sat, 23 Feb 2002 16:46:37 -0800 From: Alfred Perlstein To: Matthew Dillon Cc: John Baldwin , Seigo Tanimura , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/coda coda_venus.c src/sys/compat/linprocfs Message-ID: <20020224004637.GO80761@elvis.mu.org> References: <200202232030.g1NKU4m87533@freefall.freebsd.org> <20020223204610.GG80761@elvis.mu.org> <200202232056.g1NKuKf41350@apollo.backplane.com> <20020223212005.GK80761@elvis.mu.org> <200202232212.g1NMCI041812@apollo.backplane.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200202232212.g1NMCI041812@apollo.backplane.com> User-Agent: Mutt/1.3.27i Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG * Matthew Dillon [020223 14:12] wrote: > > : > :I've also asked john to implement a sleephold()/sleepdrop() functionaity. > : > :the premise is this: > : > :As you've noticed there's a bunch of code in sys/kern and sys/vm that > :has comments to the effect of: > : "this shouldn't block, but i'm not sure" > : > :Well, since for the most part blocking occurs rarely, what you do is > :keep a nested count in the proc struct that records weather or not you > :can sleep. > : > :Basically you have a td->td_sleephold that starts at zero, sleephold() > :will td->td_sleephold++, and sleepdrop() will td->td_sleephold-- > :as well as check for < 0. > > I'm fairly sure that the only time we can't block occurs while we are > holding a leaf mutex. The MTX_LEAF flag in the thread may be sufficient. > After all, why else would you not be able to sleep? You are an interrupt? -- -Alfred Perlstein [alfred@freebsd.org] 'Instead of asking why a piece of software is using "1970s technology," start asking why software is ignoring 30 years of accumulated wisdom.' Tax deductible donations for FreeBSD: http://www.freebsdfoundation.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message