Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Aug 1996 22:29:30 -0700
From:      Julian Elischer <julian@whistle.com>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        CVS-committers@freefall.freebsd.org, cvs-all@freefall.freebsd.org, cvs-sys@freefall.freebsd.org, julian@freefall.freebsd.org
Subject:   Re: cvs commit:  src/sys/dev/vn vn.c src/sys/i386/i386 machdep.c src/sys/kern kern_shutdown.c kern_xxx.c subr_prf.c
Message-ID:  <32194D3A.2781E494@whistle.com>
References:  <199608200408.OAA08263@godzilla.zeta.org.au>

next in thread | previous in thread | raw e-mail | index | archive | help

Bruce Evans wrote:
> 
> >  Modified:    sys/dev/vn  vn.c
> >               sys/i386/i386  machdep.c
> >               sys/kern  kern_shutdown.c kern_xxx.c subr_prf.c
> >  Log:
> >   Collect all the functioons concerned with rebooting into one place
> >  also add the at_shutdown callout list, and change the one user of
> >  the present (broken) method (the vn driver) to use the new scheme.
> 
> The broken method is no longer used and should never be used, so support
> for it (cleanups, cleanup_set, executing the cleanups) should be deleted.

I wasn't sure that some 3rd party wasn't using it in a proprietary 
module so decided to make it NOISY for a while before deleting it..
it'll go away..
It's broken because LKMs will never call it.

> 
> The old code didn't execute the cleanups if RB_NOSYNC was set.   RB_NOSYNC
> is abused (*) as a flag to indicate recursive panics.  This seems to be
> handled better now.

yes I was going to look at this some more too, it really shouldn't be
overloading RB_NOSYNC but should have a local static var for this
purpose.

> 
> (*) Bad things happen if RB_NOSYNC is set for other reasons, as it is
> for non-panics in shutdown_nice(): cleanups aren't done and
> dev_shutdownall() isn't called; OTOH if a panic occurs() inside boot()
> where boot() has been called for a non-panic, then panic() uses its own
> boot options usually clobbers any RB_NOSYNC option.

With  it all in one place it get's a little easier to see what needs to
be done..

> 
> Ordering of the shutdown is very delicate, and currently broken.  The
> current order seems best:
> 
>         first, things in the shutdown list, in unspecified order
>                 (callers of at_shutdown() shouldn't depend on the
>                 each other)
>         second, sync()
>         third, dev_shutdownall()
> 
> This shows that the one user of at_shutdown() (vn) shouldn't use
> at_shutdown() :-). 

The one CHECKED IN user.. I have two proprietary users already
but the point is that it SHOULD use something similar, because
it is a separate module and shouldn't require a #if NVN > 0 
in shutdown to make it work..


> vnshutdown removes devices, but shutdown functions
> must not remove devices because sync() may want to write to the
> devices.
> 
> The commented out cpu_boot() may need to be in a different order or
> split up into before and after pieces for each of the sections above.
> Leave it out completely until it actually does something.

I left it commmented out because I couldn't figure out that question..
(where to put it). I have started thinking about having some ordering
e.g. similar to the SYSINIT ordering, maybe a couple of categories..
the last of which would be shutting down raw devices.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?32194D3A.2781E494>