Subject: Re: apm spinning down drives
To: Peter Seebach <seebs@plethora.net>
From: Ken Hornstein <kenh@cmf.nrl.navy.mil>
List: port-i386
Date: 01/18/2000 00:31:48
>---
>atactl wd0 setidle 0
>atactl wd0 setstandby 0
>---
>
>in /etc/apm/line, but it doesn't seem to do what I want.

Really?  What does it do/not do?  BTW .... try taking out the setidle,
I only use standby (I get the sense most drives ignore the idle timer,
but I could see it causing weird effects).

>BTW, is it really a feature for 'setstandby 0' to put the device in standby
>mode immediately?  I'd think it'd make more sense not to do that, since you're
>in the process of disabling the standby timer.

I completely agree; it's silly.  _However_ .... this isn't something
I ever figured out how to work around.  The ATA specification says
for the STANDBY command, the disk is spun down and the standby
timer is set.  atactl just sends the appropriate ATA command to
the drive.  I believe some drives have vendor-specific commands to
just set the standby timer, but I never figured out what they were.
When I perused the relevant Linux drivers, they just used the same
STANDBY command as I am using, so I don't think they're any better.

Geez, I should really document this misfeature in BUGS/CAVEATS ...

>Actually, in general, I think setting the timers should not affect the drive
>mode.  As a concrete example, I have
>	setstandby 600
>in my /etc/apm/battery - the result of which is that, if I unplug the laptop,
>the drive is spun down and then *IMMEDIATELY* spun back up, to finish writing
>logs to disk.  This is, at best, silly.

No argument here.  I really _did_ try to figure out how to fix this
brokenness, but it seems to be the fault of the damn drive
manufacturers.  The command is actually quite bizarre; one particular
timer value means "21 minutes"; another means "21 minutes and
15 seconds".  There's a weird calculation you do for the rest.

BTW, I think that in the interest of power conservation, 600 seconds
is way too long.  I have mine set to 10.  There were some interesting
Usenix papers on this subject (see the references on the NetBSD
help pages about power management).  One paper documented that the
break-even point for disk spinup is about 6 seconds (if the disk
sleeps longer than 6 seconds, you're saving power).  Both papers
agreed that default spindown times were much too long.  But don't
believe me; read the papers and decide for yourself.

--Ken