Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Aug 1996 14:08:14 +1000
From:      Bruce Evans <bde@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
Message-ID:  <199608200408.OAA08263@godzilla.zeta.org.au>

index | next in thread | raw e-mail

>  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


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199608200408.OAA08263>