From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 27 13:02:02 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 6EBF2106564A; Wed, 27 Oct 2010 13:02:02 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ww0-f42.google.com (mail-ww0-f42.google.com [74.125.82.42]) by mx1.freebsd.org (Postfix) with ESMTP id 97B048FC13; Wed, 27 Oct 2010 13:02:01 +0000 (UTC) Received: by wwi18 with SMTP id 18so1533924wwi.1 for ; Wed, 27 Oct 2010 06:02:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=R2bQPTQxe6Gm+mSj6EXmuSsshccXrgEovaqRB5pxXZo=; b=G3FND6PPd4XvGNmOKAPExSAWir/MAmP7JlgnQCP9u1N9Flq3XaloDnM5jy6GCMfL1U /keZQyrremh8gs05SHsf0CkfHkXzCVPZUtt8zJ8Hnr42wdCozywaIXqdeOBugk8wR0wm WBm6zMlweZUF9Pvo7kunkr0jR6DPamyAzKzH4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=AUTtvK5Nvf1zUiuZp6wLcwA2OPeWYXjCm2xC52wpyv42pKSQyZi70DlrfK35elj5WR yMY+HEqqyv/QGe4MLhs3jXDi2YbuQQQETBXNLIAe2XEXVfRb4eim2Leidg6ZqHrfyB/W Z/XKwRW+kqfYwycd0MvbB0fwS5vpXDzcAh+gM= MIME-Version: 1.0 Received: by 10.227.134.142 with SMTP id j14mr9286672wbt.228.1288184520416; Wed, 27 Oct 2010 06:02:00 -0700 (PDT) Sender: yanegomi@gmail.com Received: by 10.216.10.198 with HTTP; Wed, 27 Oct 2010 06:02:00 -0700 (PDT) In-Reply-To: <20101027125453.GA8433@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> <20101021134114.GB72290@freebsd.org> <20101027124113.GA6206@freebsd.org> <20101027125453.GA8433@freebsd.org> Date: Wed, 27 Oct 2010 06:02:00 -0700 X-Google-Sender-Auth: Z0pwczK4aykoq2EyPFPpVxiHlg8 Message-ID: From: Garrett Cooper To: Alexander Best Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Bruce Cran , Tijl Coosemans , Oliver Fromme , freebsd-hackers@freebsd.org, mav@freebsd.org, =?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= 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: Wed, 27 Oct 2010 13:02:02 -0000 On Wed, Oct 27, 2010 at 5:54 AM, Alexander Best wrote= : > On Wed Oct 27 10, Garrett Cooper wrote: >> On Wed, Oct 27, 2010 at 5:41 AM, Alexander Best wr= ote: >> > On Thu Oct 21 10, Alexander Best wrote: >> >> On Thu Oct 21 10, Bruce Cran wrote: >> >> > On Thu, 21 Oct 2010 14:33:49 +0200 >> >> > Dag-Erling Sm=F8rgrav wrote: >> >> > >> >> > > The problem with setting a short idle timeout is that, on a typic= al >> >> > > laptop or desktop system, you end up spinning the disk down and b= ack >> >> > > 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 ju= st a >> >> > few minutes? =A0I'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 thei= r >> >> > HDDs that powers the disk down after 7 seconds! >> >> >> >> personally i still think something like the attached patch would be n= ice 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/s= he is >> >> performing actions which could damage the hardware. >> > >> > i just stumbled upon PR 144770, where a somebody seems to have mistake= n the >> > spindown value for minutes instead of seconds. so i really think we sh= ould have >> > this warning in atacontrol! >> > >> > +1 from brucec, if i understood him correctly. >> > >> > another possibility would be of course changing the spindown value fro= m seconds >> > to minutes. imo this seems very reasonable, because measuring spindown= time in >> > seconds is too fine grained and not intuitive. just like specifying th= e >> > 'shutdown -p XX' delay in microseconds would not be useful. ;) >> > >> > cheers. >> > alex >> > >> >> >> >> cheers. >> >> alex >> >> >> >> > >> >> > -- >> >> > Bruce Cran >> >> >> >> -- >> >> a13x >> > >> >> diff --git a/sbin/atacontrol/atacontrol.c b/sbin/atacontrol/atacontro= l.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) >> >> >> >> =A0 =A0 =A0 if (arg !=3D NULL) { >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 tmo =3D strtoul(arg, NULL, 0); >> >> + =A0 =A0 =A0 =A0 =A0 =A0 if (tmo < 600) >> >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 warnx("setting spindown tim= eout below 10 minutes is \ >> >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 not recommended= (see EXAMPLES section of \ >> >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 atacontrol(8))\= n"); >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (ioctl(fd, IOCATASSPINDOWN, &tmo) < 0) >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 err(1, "ioctl(IOCATASSPIN= DOWN)"); >> >> =A0 =A0 =A0 } else { >> >> =A0 =A0 Why not just be consistent with other interfaces and provide >> suffixes for the values to parse out integral times (i.e. 1 [second], >> 1m, 2h)? As long as the value is behavior is properly documented in >> the manpage (and potentially as examples in the usage message), that >> should be enough. > > that would increase usability, since users don't have to specify large va= lues > in seconds, if they e.g. want the spindown to happen after 24 hours (24*6= 0*60). > but this will not solve the real issue: specifying 'atacontrol spindown 1= s' > WILL damage your hardware! imo users should be reminded about this even i= f this > is already mentioned in the manual. Maybe something similar to kern.geom.debugflags should be implemented for this feature as a safety belt for people doing something stupid? > also: will current scripts which set 'atacontrol spindown 600' e.g. conti= nue to > work after implementing the use of suffixes? Yeah... why not :)? Thanks! -Garrett