From owner-freebsd-hackers@FreeBSD.ORG Thu Feb 4 13:46:07 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD34B1065676 for ; Thu, 4 Feb 2010 13:46:07 +0000 (UTC) (envelope-from aduane@juniper.net) Received: from exprod7og109.obsmtp.com (exprod7og109.obsmtp.com [64.18.2.171]) by mx1.freebsd.org (Postfix) with ESMTP id 58AC48FC16 for ; Thu, 4 Feb 2010 13:46:07 +0000 (UTC) Received: from source ([66.129.224.36]) (using TLSv1) by exprod7ob109.postini.com ([64.18.6.12]) with SMTP ID DSNKS2rPnsAVIXYuQZrj6RL7sF9Q4L7W37eh@postini.com; Thu, 04 Feb 2010 05:46:07 PST Received: from p-emfe01-wf.jnpr.net (172.28.145.24) by P-EMHUB02-HQ.jnpr.net (172.24.192.36) with Microsoft SMTP Server (TLS) id 8.1.393.1; Thu, 4 Feb 2010 05:32:35 -0800 Received: from EMBX01-WF.jnpr.net ([fe80::1914:3299:33d9:e43b]) by p-emfe01-wf.jnpr.net ([fe80::d0d1:653d:5b91:a123%11]) with mapi; Thu, 4 Feb 2010 08:32:34 -0500 From: Andrew Duane To: Warren Block , Erich Dollansky Date: Thu, 4 Feb 2010 08:28:39 -0500 Thread-Topic: Spin down HDD after disk sync or before power off Thread-Index: AcqlTER3spR7xSv3SjqFFTvwXEyKoQAUbG+V Message-ID: References: <201002031343.o13Dhj7i052507@lurza.secnetix.de> <201002041009.05222.erich@alogreentechnologies.com>, In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "freebsd-hackers@freebsd.org" Subject: RE: Spin down HDD after disk sync or before power off X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Feb 2010 13:46:07 -0000 ________________________________________ From: owner-freebsd-hackers@freebsd.org [owner-freebsd-hackers@freebsd.org]= On Behalf Of Warren Block [wblock@wonkity.com] Sent: Wednesday, February 03, 2010 7:43 PM To: Erich Dollansky Cc: freebsd-hackers@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 t= he 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" va= riable; we do this quite a bit on some of our platforms that need special h= andling 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, S= HUTDOWN_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@juniper.net Westford, MA 01886-3418