Spin down HDD after disk sync or before power off
Andrew Duane
aduane at juniper.net
Thu Feb 4 13:46:07 UTC 2010
________________________________________
From: owner-freebsd-hackers at freebsd.org [owner-freebsd-hackers at freebsd.org] On Behalf Of Warren Block [wblock at wonkity.com]
Sent: Wednesday, February 03, 2010 7:43 PM
To: Erich Dollansky
Cc: freebsd-hackers at freebsd.org
Subject: Re: Spin down HDD after disk sync or before power off
On Thu, 4 Feb 2010, Erich Dollansky wrote:
> In case of a reboot, it is already known when the command is given that the machine will restart without being powered of.
>
> If you spin-down the disk, you lose one start cycle.
>
> It is not that important but if it can be done with just one if, please, just do it.
AFAICT ad_shutdown can't tell whether it's called for a reboot or a
poweroff, it's just told to "shut down". So maybe it's one if, but it's
somewhere above ata-disk.c but below reboot(RB_POWEROFF).
-Warren Block * Rapid City, South Dakota USA
________________________________________
You can register for a shutdown even that *does* get to know the "howto" variable; we do this quite a bit on some of our platforms that need special handling at power-off versus halt.
extern void jsrxnle_poweroff_devices(void *junk, int howto);
/* Registering power-off handler to be called at the system shutdown */
EVENTHANDLER_REGISTER(shutdown_final, jsrxnle_poweroff_devices, NULL, SHUTDOWN_PRI_LAST + 10);
The howto argument can be checked for RB_POWEROFF:
if (howto & RB_POWEROFF) {
/* Spin Down */
}
--
Andrew Duane Juniper Networks
978-589-0551 10 Technology Park Dr
aduane at juniper.net Westford, MA 01886-3418
More information about the freebsd-hackers
mailing list