From owner-cvs-sys Mon Aug 19 22:31:29 1996 Return-Path: owner-cvs-sys Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id WAA22149 for cvs-sys-outgoing; Mon, 19 Aug 1996 22:31:29 -0700 (PDT) Received: from whistle.com (s205m131.whistle.com [207.76.205.131]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id WAA22144; Mon, 19 Aug 1996 22:31:26 -0700 (PDT) Received: (from smap@localhost) by whistle.com (8.7.5/8.6.12) id WAA17347; Mon, 19 Aug 1996 22:30:48 -0700 (PDT) Received: from current1.whistle.com(207.76.205.22) by whistle.com via smap (V1.3) id sma017345; Mon Aug 19 22:30:23 1996 Message-ID: <32194D3A.2781E494@whistle.com> Date: Mon, 19 Aug 1996 22:29:30 -0700 From: Julian Elischer Organization: Whistle Communications X-Mailer: Mozilla 3.0b6 (X11; I; FreeBSD 2.2-CURRENT i386) MIME-Version: 1.0 To: Bruce Evans 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 References: <199608200408.OAA08263@godzilla.zeta.org.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-cvs-sys@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk 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.