tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: new shutdown order



On Tue, Apr 28, 2009 at 08:14:31PM -0500, David Young wrote:
> On Mon, Apr 20, 2009 at 11:13:06PM -0400, der Mouse wrote:
> > >         1 Try to "gently" unmount all filesystems.
> > >         2 Try to detach all devices and pseudo-devices.
> > >         3 If step 1 or step 2 detached any device or filesystem, goto
> > >           step 1.  Otherwise, continue.
> > >         4 Try to forcefully unmount a filesystem.
> > >         5 Try to detach all devices and pseudo-devices.
> > >         6 If step 4 or step 5 detached any device or filesystem, goto
> > >           step 4.  Otherwise, end.
> > 
> > I would say goto step 1, not step 4, in step 6 - once you force an
> > unmount, a bunch more stuff may unstack without needing
> > sledgehammering.
> 
> Oh!  Thanks for pointing that out.  I will try to avoid the
> sledgehammer.
> 
> > As you point out in another message, you really want to pick the
> > "topmost" filesystem to force-unmount in step 4, but it's not at all
> > clear how to find that programmatically; something must be held active
> > or it would have unmounted gently, and it's not obvious how to
> > determine which is the best unmount to force.
> 
> Greg Oster suggested adding a timestamp or generation number to each
> mount, scanning for and forcing the unmount of only the most recent
> mount.  Works for me. :-)

<ftp://cuw.ojctech.com/users/netbsd-202ea70d/new-shutdown-order.patch0>
is a patch derived from my work in progress.  Note that I have omitted
the traditional doshutdownhooks() call from cpu_reboot().  Also, I have
re-ordered dumps and other operations.  I have not started assigning
generation numbers to the new struct mount member, mnt_gen, yet.

Dave

-- 
David Young             OJC Technologies
dyoung%ojctech.com@localhost      Urbana, IL * (217) 278-3933


Home | Main Index | Thread Index | Old Index