Date: Wed, 27 Oct 2010 05:45:57 -0700 From: Garrett Cooper <gcooper@FreeBSD.org> To: Alexander Best <arundel@freebsd.org> Cc: Bruce Cran <bruce@cran.org.uk>, Tijl Coosemans <tijl@coosemans.org>, Oliver Fromme <olli@lurza.secnetix.de>, freebsd-hackers@freebsd.org, mav@freebsd.org, =?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= <des@des.no> Subject: Re: Summary: Re: Spin down HDD after disk sync or before power off Message-ID: <AANLkTi=hvkXvAkv68jjpJSKSKZ5a-0yn=Vje4ZjSPc=F@mail.gmail.com> In-Reply-To: <20101027124113.GA6206@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>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Oct 27, 2010 at 5:41 AM, Alexander Best <arundel@freebsd.org> wrote= : > 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 <des@des.no> 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? =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 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 me= ntioned >> in atacontrol(4) it might still be worth reminding the user that he/she = is >> performing actions which could damage the hardware. > > i just stumbled upon PR 144770, where a somebody seems to have mistaken t= he > spindown value for minutes instead of seconds. so i really think we shoul= d have > this warning in atacontrol! > > +1 from brucec, if i understood him correctly. > > another possibility would be of course changing the spindown value from s= econds > to minutes. imo this seems very reasonable, because measuring spindown ti= me in > seconds is too fine grained and not intuitive. just like specifying the > '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/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 *a= rg) >> >> =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 timeou= t below 10 minutes is \ >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 not recommended (s= ee 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(IOCATASSPINDOW= N)"); >> =A0 =A0 =A0 } else { 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. Thanks, -Garrett
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTi=hvkXvAkv68jjpJSKSKZ5a-0yn=Vje4ZjSPc=F>