Re: Laptop shock detection and harddisk protection

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Tejun Heo <tj@...>
Cc: Shem Multinymous <multinymous@...>, Thomas Renninger <trenn@...>, Linux Kernel Mailing List <linux-kernel@...>, IDE/ATA development list <linux-ide@...>
Date: Thursday, September 11, 2008 - 4:00 pm

Tejun Heo <tj@kernel.org> wrote:
[...]

Short of a satisfying proposition regarding the questions raised, I just
want to add two things that would be nice to solve in the future one way
or another and should perhaps be taken into consideration from the
beginning:

1. Disable polling completely when it isn't required: once the hd has
   spun down, there is no need to keep polling the sensors at all. Only
   when the first request requiring the hd to spin up arrives, the
   kernel needs to hold back for a short while to gather enough data
   from the sensors, so shock protection is up and running again.
2. Make shock protection interact nicely with suspend operations:
   currently, we are out of luck if anything should happen after
   processes have been frozen. This is particularly unfortunatel in the
   case of s2disk.

As far as 1. is concerned, I'm not quite sure yet how to determine when
the disk has spun down since this may have happened according to vendor
specific timing rules. Once we have established that the disk is
sleeping safe and sound, sensor drivers can be notified to stop polling
the hardware and possibly notify clients (like hdapsd) about that fact.

Something along the lines of the disk_shock module approach suggested by
Bart in [1] sounds promising, but it still needs some careful thinking
when designing the interfaces to all components involved. As for the
suspend problem, we could either put some simplified logic into
disk_shock so it can take over once hdapsd has been frozen, or we can
find a way to keep hdapsd unfrozen until the hd has been put to sleep.
Of course, we'd have to think about resume as well, although it'll be
impossible to protect right from the start in the s2disk case.

Regards,

Elias

[1] http://marc.info/?l=linux-kernel&m=122021163324843&w=2
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: Laptop shock detection and harddisk protection, Elias Oltmanns, (Thu Sep 11, 4:00 pm)
Re: Laptop shock detection and harddisk protection, Pavel Machek, (Sun Aug 17, 3:51 pm)
Re: Laptop shock detection and harddisk protection, Elias Oltmanns, (Wed Sep 17, 11:21 am)
Re: Laptop shock detection and harddisk protection, Shem Multinymous, (Wed Sep 17, 3:36 pm)