From owner-freebsd-smp Fri Oct 6 3:30:42 2000 Delivered-To: freebsd-smp@freebsd.org Received: from mail.du.gtn.com (mail.du.gtn.com [194.77.9.57]) by hub.freebsd.org (Postfix) with ESMTP id 07BFE37B502; Fri, 6 Oct 2000 03:30:39 -0700 (PDT) Received: from mail.cicely.de (cicely.de [194.231.9.142]) by mail.du.gtn.com (8.11.0.Beta3/8.11.0.Beta3) with ESMTP id e96AUTJ17217 (using TLSv1/SSLv3 with cipher EDH-RSA-DES-CBC3-SHA (168 bits) verified OK); Fri, 6 Oct 2000 12:30:32 +0200 (MET DST) Received: from cicely5.cicely.de (cicely5.cicely.de [fec0::104:200:92ff:fe9b:20e7]) by mail.cicely.de (8.11.0.Beta1/8.11.0.Beta1) with ESMTP id e96AV0T65223; Fri, 6 Oct 2000 12:31:00 +0200 (CEST) Received: (from ticso@localhost) by cicely5.cicely.de (8.11.0/8.9.2) id e96AUr142043; Fri, 6 Oct 2000 12:30:53 +0200 (CEST) (envelope-from ticso) Date: Fri, 6 Oct 2000 12:30:53 +0200 From: Bernd Walter To: Terry Lambert Cc: John Baldwin , Jake Burkholder , Boris Popov , freebsd-smp@FreeBSD.ORG, Mark Murray Subject: Re: Problems with kthread_exit() and SMPng Message-ID: <20001006123053.A42012@cicely5.cicely.de> References: <20001006002200.E40689@cicely5.cicely.de> <200010060526.WAA22981@usr02.primenet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <200010060526.WAA22981@usr02.primenet.com>; from tlambert@primenet.com on Fri, Oct 06, 2000 at 05:26:09AM +0000 Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Fri, Oct 06, 2000 at 05:26:09AM +0000, Terry Lambert wrote: > > The situation with such functions is not uncritical as you may need to > > release other mutexes before you call printf(); > > Holding multiple mutexes should only ever occur when doing > list or other multiple pointer manipulation which needs to be > done in such a way as to appear atomic, so this is pretty > much a bogus argument. Which I understand as: Don't call another driver while owning a mutex because you never know what it might be waiting for. Giant is an exeption for this rule. The ugly point here is that I never thought about printf to be a call to another driver. > > Say you have a driver which is called via another driver (upcall, ...). > > The other driver is not updated and calls us while holding Giant and we > > need to fetch one of our own mutexes for processing. That means we have to > > own Giant before we fetch our own mutex if we want to make use of printf() > > or we need to release our before entering Giant to do printf(). > > Otherwise we don't have a fixed mutex order :( > > Grab the printf mutex, queue the request, release the printf > mutex. A mutex protexts data structure manipulations (in this > example, the events queued for console display), _not_ code. I agree but actually Giant is used to protect old code. -- B.Walter COSMO-Project http://www.cosmo-project.de ticso@cicely.de Usergroup info@cosmo-project.de To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message