From owner-freebsd-smp Thu Oct 5 15:15:29 2000 Delivered-To: freebsd-smp@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id 4F7BB37B502 for ; Thu, 5 Oct 2000 15:15:26 -0700 (PDT) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id e95MF5U08444; Thu, 5 Oct 2000 15:15:05 -0700 (PDT) Date: Thu, 5 Oct 2000 15:15:04 -0700 From: Alfred Perlstein To: Terry Lambert Cc: Mark Murray , Jake Burkholder , Boris Popov , freebsd-smp@FreeBSD.ORG Subject: Re: Problems with kthread_exit() and SMPng Message-ID: <20001005151504.K27736@fw.wintelcom.net> References: <20001005113139.C27736@fw.wintelcom.net> <200010052142.OAA15421@usr05.primenet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.4i In-Reply-To: <200010052142.OAA15421@usr05.primenet.com>; from tlambert@primenet.com on Thu, Oct 05, 2000 at 09:42:28PM +0000 Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org * Terry Lambert [001005 14:42] wrote: > > > There is another problem; printf's inside a kthread corrupt like > > > crazy. They look very unthreadsafe. > > > > do NOT use printf without Giant. > > This strikes me as being rather inane. > > If printf won't work without holging the lock, then it damn well > should acquire the lock if it isn't already held, and release it > if it acquired it, before returning. > > This is not something that a programmer should have to worry > about when they use a service; unless you are doing threads > IPC, perhaps in some vainglorious attempt to make SMP systems > stall their little butts off with interprocessor synchrnization, > this should never be an issue. > > In other words, I don't give a damn, as a programmer, whether > a service is reentrant or not, so long as it works when I call > it. Having the lock fairy sprinkle lock primitives before and > after every service call is not my idea of a Good Thing. > > > This appears to be a very good point to note that having an > owner or recursing on this lock would both end up being Very > Bad Things, since it would make the obvious and intuitive > (and therefore least astonishing) behaviour impossible. One of the options for fixing kernel logging under SMP was to have a very simple queing mechanism to send the messages to a kernel thread that would be repsoncible for the output. You see, the problem with logging is that the logging calls are in a lot of weird places, nevermind critical ones like panic, there needs to be a special relationship between the logging kthread and the system which may be difficult to set up. You also have to take into account that the output method of the driver might block therefore we need to hand off the blocking to someone else. -- -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] "I have the heart of a child; I keep it in a jar on my desk." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message