From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 16 15:06:46 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 B3072106567A for ; Thu, 16 Sep 2010 15:06:46 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from agogare.doit.wisc.edu (agogare.doit.wisc.edu [144.92.197.211]) by mx1.freebsd.org (Postfix) with ESMTP id 7AFD28FC22 for ; Thu, 16 Sep 2010 15:06:46 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0L8U00600HZ93V00@smtpauth2.wiscmail.wisc.edu> for freebsd-hackers@freebsd.org; Thu, 16 Sep 2010 10:06:45 -0500 (CDT) Received: from comporellon.tachypleus.net ([unknown] [76.210.68.10]) by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0L8U00HVUHZ8TI40@smtpauth2.wiscmail.wisc.edu> for freebsd-hackers@freebsd.org; Thu, 16 Sep 2010 10:06:45 -0500 (CDT) Date: Thu, 16 Sep 2010 10:06:44 -0500 From: Nathan Whitehorn In-reply-to: To: freebsd-hackers@freebsd.org Message-id: <4C923284.20304@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.210.68.10 X-Spam-PmxInfo: Server=avs-9, Version=5.6.0.2009776, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2010.9.16.145715, SenderIP=76.210.68.10 X-Enigmail-Version: 1.0.1 References: <201009152143.o8FLhE9p022233@lurza.secnetix.de> <20100916004902.GA46401@freebsd.org> User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.12) Gecko/20100909 Thunderbird/3.0.7 Subject: Re: Summary: 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, 16 Sep 2010 15:06:46 -0000 On 09/16/10 09:42, Warren Block wrote: > On Thu, 16 Sep 2010, Alexander Best wrote: > >> On Wed Sep 15 10, Oliver Fromme wrote: >>> Warren Block wrote: >>> > [...] >>> > 8. Alexander Motin has an updated CAM version of the ATA system which >>> > will eventually replace the existing one. In -CURRENT, anyway. >>> He was >>> > kind enough to look at my event handler. My understanding is that >>> he is >>> > looking at implementing the head parking/standby mechanism in that >>> new >>> > code. >>> >>> The patch below will work with the new CAM ATA driver >>> (i.e. ada(4) disks). It adds a sysctl, so you can switch >>> the spin-down off if you're going to just reboot: >>> # sysctl kern.cam.ada.spindown_shutdown=0 >> >> i haven't tested your patch yet, but i don't think deciding whether >> to spin >> down the hdd should be decided merely from the sysctl value. >> >> the hdd should spindown when a shutdown has been issued and not >> spindown, >> if a reboot has been issued. > > It's been a while, but the problem I found when comparing the NetBSD > code was that there didn't appear to be a way to tell from within the > FreeBSD driver whether it was a shutdown or reboot. Register a shutdown event handler? The second argument can be tested against RB_HALT to determine what is happening. -Nathan