From owner-cvs-src@FreeBSD.ORG Wed Nov 9 16:35:18 2005 Return-Path: X-Original-To: cvs-src@freebsd.org Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 92EA916A41F; Wed, 9 Nov 2005 16:35:18 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail5.speedfactory.net [66.23.216.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id D586043D45; Wed, 9 Nov 2005 16:35:17 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.5b3) with ESMTP id 1650412 for multiple; Wed, 09 Nov 2005 11:36:52 -0500 Received: from localhost (john@localhost [127.0.0.1]) by server.baldwin.cx (8.13.1/8.13.1) with ESMTP id jA9GYhod035972; Wed, 9 Nov 2005 11:34:43 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: "M. Warner Losh" Date: Wed, 9 Nov 2005 11:34:06 -0500 User-Agent: KMail/1.8.2 References: <20051109204951.K68350@delplex.bde.org> <200511091001.45475.jhb@freebsd.org> <20051109.092541.107741797.imp@bsdimp.com> In-Reply-To: <20051109.092541.107741797.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200511091134.09040.jhb@freebsd.org> X-Spam-Status: No, score=-2.8 required=4.2 tests=ALL_TRUSTED autolearn=failed version=3.0.2 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on server.baldwin.cx X-Server: High Performance Mail Server - http://surgemail.com r=1653887525 Cc: cvs-src@freebsd.org, scottl@samsco.org, src-committers@freebsd.org, cvs-all@freebsd.org, bde@zeta.org.au Subject: Re: cvs commit: src/sys/kern subr_power.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2005 16:35:18 -0000 On Wednesday 09 November 2005 11:25 am, M. Warner Losh wrote: > In message: <200511091001.45475.jhb@freebsd.org> > > John Baldwin writes: > : On Wednesday 09 November 2005 08:56 am, Scott Long wrote: > : > Bruce Evans wrote: > : > > On Wed, 9 Nov 2005, Warner Losh wrote: > : > >> Modified files: > : > >> sys/kern subr_power.c > : > >> Log: > : > >> Kick off the suspend sequence from the keyboard in a SWI rather > : > >> than in the hardware interrupt context (even if it is likely just an > : > >> ithread). We don't document that suspend/resume routines are run > : > >> from such a context and some of the things that happen in those > : > >> routines aren't interrupt safe. Since there's no real need to run > : > >> from that context, this restores assumptions that suspend routines > : > >> have made. > : > >> > : > >> This fixes Thierry Herbelot's 'Trying to sleep while sleeping is > : > >> prohibited' problem. > : > > > : > > Er, SWIs are interrupts too. Trying to sleep in a SWI handler should > : > > cause the same message. This commit uses the general taskqueue SWI > : > > handler. taskqueue(9) implicitly says that only the taskqueue thread > : > > handler can sleep (it gives malloc(M_WAITOK) as an example of > : > > something that can only be done in thread context). > : > > > : > > Bruce > : > > : > You're right, but sleeping in SWI's has never been enforced. CAM > : > relies on it, for better or worse, and until that's fixed it's > : > pointless to start enforcing it. > : > : Well, I don't think we should knowingly go around adding more instances > : of it. :) In this case it is really easy to just use taskqueue_thread > : rather than taskqueue_swi. > > SWI, thread, what's the difference? [*] In this case, nothing bad will > happen if we do this in a thread and bad things might happen in the > future if we don't. Sounds like a no-brainer: I changed it to > taskqueue_thread. > > Warner > > [*] That's actually a good question to have answered in the taskqueue > man page... I use it as a rhetorical question here... I've thought about killing taskqueue_swi in favor of taskqueue_thread actually. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org