From owner-cvs-sys Mon Aug 19 21:22:24 1996 Return-Path: owner-cvs-sys Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id VAA16661 for cvs-sys-outgoing; Mon, 19 Aug 1996 21:22:24 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id VAA16644; Mon, 19 Aug 1996 21:22:18 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.12/8.6.9) id OAA08263; Tue, 20 Aug 1996 14:08:14 +1000 Date: Tue, 20 Aug 1996 14:08:14 +1000 From: Bruce Evans Message-Id: <199608200408.OAA08263@godzilla.zeta.org.au> To: 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 Sender: owner-cvs-sys@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > 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. 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. (*) 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. 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() :-). 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. Bruce