From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 21 13:41:14 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 856961065674; Thu, 21 Oct 2010 13:41:14 +0000 (UTC) Date: Thu, 21 Oct 2010 13:41:14 +0000 From: Alexander Best To: Bruce Cran Message-ID: <20101021134114.GB72290@freebsd.org> References: <201009161742.24228.tijl@coosemans.org> <201009161619.o8GGJAmv035378@lurza.secnetix.de> <20101018155944.GA12425@freebsd.org> <868w1r92rf.fsf@ds4.des.no> <20101021122110.GA65490@freebsd.org> <86zku77mj6.fsf@ds4.des.no> <20101021135442.000054c9@unknown> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="9amGYk9869ThD9tj" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20101021135442.000054c9@unknown> Cc: Dag-Erling =?iso-8859-15?Q?Sm=F8rgrav?= , mav@freebsd.org, Tijl Coosemans , Oliver Fromme , freebsd-hackers@freebsd.org 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, 21 Oct 2010 13:41:14 -0000 --9amGYk9869ThD9tj Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Thu Oct 21 10, Bruce Cran wrote: > On Thu, 21 Oct 2010 14:33:49 +0200 > Dag-Erling Smørgrav wrote: > > > The problem with setting a short idle timeout is that, on a typical > > laptop or desktop system, you end up spinning the disk down and back > > up several hundred times a day, which increases power consumption, I/O > > latency and wear. > > Do we think our users are silly enough to set a short timeout of just a > few minutes? I'd think most would use a setting of 20-30 minutes at > a minimum. I never did understand why there were so many warnings; > after all, some laptops even come with a default APM scheme in their > HDDs that powers the disk down after 7 seconds! personally i still think something like the attached patch would be nice to have. there's a chance users might type the following: 'atacontrol spindown device 10' thinking the timeout value is measured in minutes. although this gets mentioned in atacontrol(4) it might still be worth reminding the user that he/she is performing actions which could damage the hardware. cheers. alex > > -- > Bruce Cran -- a13x --9amGYk9869ThD9tj Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="atacontrol.c.diff" diff --git a/sbin/atacontrol/atacontrol.c b/sbin/atacontrol/atacontrol.c index 4354ddf..75a131a 100644 --- a/sbin/atacontrol/atacontrol.c +++ b/sbin/atacontrol/atacontrol.c @@ -317,6 +317,10 @@ ata_spindown(int fd, const char *dev, const char *arg) if (arg != NULL) { tmo = strtoul(arg, NULL, 0); + if (tmo < 600) + warnx("setting spindown timeout below 10 minutes is \ + not recommended (see EXAMPLES section of \ + atacontrol(8))\n"); if (ioctl(fd, IOCATASSPINDOWN, &tmo) < 0) err(1, "ioctl(IOCATASSPINDOWN)"); } else { --9amGYk9869ThD9tj--