Date: Wed, 27 Jan 2010 13:34:57 +0100 (CET) From: Oliver Fromme <olli@lurza.secnetix.de> To: freebsd-hackers@FreeBSD.ORG, alexbestms@wwu.de Subject: Re: Spin down HDD after disk sync or before power off Message-ID: <201001271234.o0RCYvbe040070@lurza.secnetix.de> In-Reply-To: <permail-20100126191723f7e55a9d00001a52-a_best01@message-id.uni-muenster.de>
next in thread | previous in thread | raw e-mail | index | archive | help
Alexander Best <alexbestms@wwu.de> 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001271234.o0RCYvbe040070>