From owner-freebsd-hackers@FreeBSD.ORG Wed Jan 27 12:35:15 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 1EEA7106566B for ; Wed, 27 Jan 2010 12:35:15 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [IPv6:2a01:170:102f::2]) by mx1.freebsd.org (Postfix) with ESMTP id 99FB48FC1A for ; Wed, 27 Jan 2010 12:35:14 +0000 (UTC) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.3/8.14.3) with ESMTP id o0RCYvh7040071; Wed, 27 Jan 2010 13:35:12 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.3/8.14.3/Submit) id o0RCYvbe040070; Wed, 27 Jan 2010 13:34:57 +0100 (CET) (envelope-from olli) Date: Wed, 27 Jan 2010 13:34:57 +0100 (CET) Message-Id: <201001271234.o0RCYvbe040070@lurza.secnetix.de> From: Oliver Fromme To: freebsd-hackers@FreeBSD.ORG, alexbestms@wwu.de In-Reply-To: X-Newsgroups: list.freebsd-hackers User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (FreeBSD/6.4-PRERELEASE-20080904 (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Wed, 27 Jan 2010 13:35:12 +0100 (CET) Cc: 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: freebsd-hackers@FreeBSD.ORG, alexbestms@wwu.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 12:35:15 -0000 Alexander Best wrote: > 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. A few comments ... First, you should not *replace* ATA_FLUSHCACHE. Rather, you should issue *both* commands, first ATA_FLUSHCACHE and then ATA_STANDBY_IMMEDIATE (maybe with a short delay between, just to be on the safe side). Second, you should make sure that ATA_STANDBY_IMMEDIATE is only used when a poweroff is requested, but not in other cases. Of course, ATA_FLUSHCACHE should *always* be sent. Finally, it would be nice if it is put under a sysctl or similar, so the feature can be switched on and off. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "Above all, they contribute to the genetic diversity in the operating system pool. Which is a good thing." -- Ruben van Staveren, on the question which BSD OS is the best one.