Shutdown/halt operation ordering

Peter Jeremy peter.jeremy at alcatel.com.au
Wed Feb 25 19:00:27 PST 2004


The low-level shutdown handling (in kern/kern_shutdown.c:boot()) does
things in the following order:
- shutdown_pre_sync events
- sync disks (unless RB_NOSYNC)
- shutdown_post_sync events
- crashdump (if RB_DUMP)
- shutdown_final events (which includes the final halt/reboot/...)

shutdown_post_sync includes invoking the shutdown handler on all
devices.  Can someone please explain why this is invoked before
dumpsys(), rather than after it?  It would seem reasonable to want
to do things like flush disk caches after the crashdump, rather than
before.  Also, this shutdown processing may disturb state information
that is relevant to the problem that made the system panic.

What is the impact of moving 
        EVENTHANDLER_INVOKE(shutdown_post_sync, howto);
to after the dumpsys() call?

-- 
Peter Jeremy


More information about the freebsd-stable mailing list