Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Nov 2005 11:34:06 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        "M. Warner Losh" <imp@bsdimp.com>
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
Message-ID:  <200511091134.09040.jhb@freebsd.org>
In-Reply-To: <20051109.092541.107741797.imp@bsdimp.com>
References:  <20051109204951.K68350@delplex.bde.org> <200511091001.45475.jhb@freebsd.org> <20051109.092541.107741797.imp@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday 09 November 2005 11:25 am, M. Warner Losh wrote:
> In message: <200511091001.45475.jhb@freebsd.org>
>
>             John Baldwin <jhb@freebsd.org> 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 <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200511091134.09040.jhb>