From owner-cvs-src@FreeBSD.ORG Wed Nov 9 16:27:56 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 5283D16A41F; Wed, 9 Nov 2005 16:27:56 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id B6EE543D46; Wed, 9 Nov 2005 16:27:55 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1] (may be forged)) by harmony.bsdimp.com (8.13.3/8.13.3) with ESMTP id jA9GP9p0040803; Wed, 9 Nov 2005 09:25:09 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Wed, 09 Nov 2005 09:25:41 -0700 (MST) Message-Id: <20051109.092541.107741797.imp@bsdimp.com> To: jhb@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <200511091001.45475.jhb@freebsd.org> References: <20051109204951.K68350@delplex.bde.org> <4371FFF1.7020902@samsco.org> <200511091001.45475.jhb@freebsd.org> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Wed, 09 Nov 2005 09:25:12 -0700 (MST) 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:27:56 -0000 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...