[ltp] Re: New PowerTOP utility for Linux 2.6.21+ from Intel

Elias Oltmanns linux-thinkpad@linux-thinkpad.org
Wed, 16 May 2007 15:34:08 +0200


Hamie <hamish@travellingkiwi.com> wrote:
> On Monday 14 May 2007 18:28, Elias Oltmanns wrote:
>> "Shem Multinymous" <multinymous@gmail.com> wrote:
>> > On 5/14/07, Martin Milata <b42-ml@srck.net> wrote:
>> >> What about checking accelerometer status only if hdd is actually
>> >> spinning? Because when using laptop_mode, hdd is spun down most of the
>> >> time, but hdapsd is doing it's work all the time. Is something like that
>> >> possible?
>> >
>> > Excellent idea. Caveats:
>>
>> Not quite as excellent as it seems at the first glance, I'm afraid. If
>> something strange is going on, i.e., when some considerable
>> acceleration is detected, I want hdapsd to prevent my hd from spinning
>> up in the first place. Otherwise, you'd always run the risk that the
>> disk spins up right in the middle of some accelerated motion and the
>
> In that case you only need to start polling just before the spin-up. 
> Admittedly you might need a delay (500-1000ms) to get around periodic 
> bumping, but at least you still wouldn't be polling whil eth HD was spun 
> down.

How is userspace to know when the disk is going to be spun up?
Ultimately, its the kernel who decides when to spin disks up or down.
Presently, hdapsd merely indicates the need for precautionary steps to
the kernel and the kernel acts accordingly, i.e., delays spinning the
disk up until the danger is over. Your suggestion implies that the
kernel would have to ask userspace, that is hdapsd, whether it is
convenient to spin up the disk now, wait for a response as hdapsd has
to update its statistical data, and finally proceed with the disk
operations on the queue. It seems to me that for this scenario the
job of hdapsd would rather have to be done by the kernel itself,
perhaps something worth considering, but certainly subject to further
discussion and commitment.

Regards,

Elias