From owner-freebsd-hackers@FreeBSD.ORG Wed Jan 27 09:44:35 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 49DB0106566B for ; Wed, 27 Jan 2010 09:44:35 +0000 (UTC) (envelope-from gary.jennejohn@freenet.de) Received: from mout5.freenet.de (mout5.freenet.de [IPv6:2001:748:100:40::2:7]) by mx1.freebsd.org (Postfix) with ESMTP id D5CF78FC1E for ; Wed, 27 Jan 2010 09:44:34 +0000 (UTC) Received: from [195.4.92.26] (helo=16.mx.freenet.de) by mout5.freenet.de with esmtpa (ID gary.jennejohn@freenet.de) (port 25) (Exim 4.70 #1) id 1Na4Rt-0007U4-Ja; Wed, 27 Jan 2010 10:44:33 +0100 Received: from p57ae1733.dip0.t-ipconnect.de ([87.174.23.51]:24704 helo=ernst.jennejohn.org) by 16.mx.freenet.de with esmtpa (ID gary.jennejohn@freenet.de) (port 25) (Exim 4.69 #94) id 1Na4Rt-0002ka-BT; Wed, 27 Jan 2010 10:44:33 +0100 Date: Wed, 27 Jan 2010 10:44:32 +0100 From: Gary Jennejohn To: Alexander Best Message-ID: <20100127104432.5de75be7@ernst.jennejohn.org> In-Reply-To: References: X-Mailer: Claws Mail 3.7.4 (GTK+ 2.16.2; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 Reply-To: gary.jennejohn@freenet.de List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2010 09:44:35 -0000 On Tue, 26 Jan 2010 20:17:23 +0100 (CET) Alexander Best wrote: > hi there, > > because of kern/140752 i looked through a discussion back in 2009 > (http://lists.freebsd.org/pipermail/freebsd-hackers/2009-March/027879.html) > concerning freebsd's hdd spin down procedure. right now ATA_FLUSHCACHE is > being used although the hitachi hdd specs referenced in the pr say that this > will not cause proper load/unload and thus an emergency unload will occur > which reduces the life expectancy of hdds dramatically (20.000 shutdowns vs. > 600.000 shutdowns). unfortunately the discussion back then didn't come up with > any sort of decision/patch. > > attached you'll find a very simple patch which issues ATA_STANDBY_IMMEDIATE > instead of ATA_FLUSHCACHE during hdd spin down. > > could somebody with hdd knowledge comment on this? this matter seems quite > important since there may be a chance that the current spin down mechanism in > freebsd damages hdds! > What if the disk doesn't support ATA_STANDBY_IMMEDIATE? Your patch then negates the benefit of calling ad_shutdown(), namely flushing the cache, if possible. I suggest putting your new code at the top and leaving the old code in an else-if clause. --- Gary Jennejohn