Subject: Re: MI changes & code ownership
To: Manuel Bouyer <bouyer@antioche.eu.org>
From: Cherry G.Mathew <cherry@zyx.in>
List: tech-kern
Date: 04/24/2006 14:26:19
On Apr 24, 2006, at 2:14 AM, Manuel Bouyer wrote:

> On Sat, Apr 22, 2006 at 10:14:13PM +0530, Cherry G. Mathew wrote:
>> The proposal is to modify MI code in kern_subr.c to pass on the howto
>> variable
>> which describes whether the shutdown event is a reboot or a shutdown
>> (or whatever else). This would
>> allow, say the wd driver to decide whether to spin down the hard disk
>> before shutting down power
>> ( this was the issue that brought up the discussion in the first 
>> place.
>> )
>
> I don't think we want howto as is here. We want a bitmask that can
> express the various bits in howto, and more. For example, I'd like
> to have shutdown hooks called 2 times: one from a valid kernel thread
> context, so that the callee can tsleep, and one with interrupt blocked
> (what we're currently doing). The call in kernel thread context would 
> be
> usefull for raidframe, at last. I suspect other mid-layers may want it
> too.
>

As far as I can tell, cpu_reboot() gets called from panic() and ddb, 
both of which
can't be assumed to be within reliable thread context AFAIU. Therefore, 
would it
be an acceptable implementation to call the shutdownhooks from
within kern_xxx.c:sys_reboot() first, and then later within 
cpu_reboot() ( with
flags indicating appropriate info) ?


> -- 
> Manuel Bouyer <bouyer@antioche.eu.org>
>      NetBSD: 26 ans d'experience feront toujours la difference
> --
>


--
~Cherry