Stronger laptop_mode in Linux
- by Vi
Can I have stronger laptop mode in Linux?
I want to spin down the hard drive and prevent it to spin up even if something wants to read something not in cache. In general I want to have these modes:
Normal
Current laptop mode
Stronger laptop mode: spin up only when needs to read something uncached (and cache it). No spinups to write something unless really memory pressure (Exception: explicit "sync" command in console). Kernel is allowed to keep processes in D-sleep for 10 seconds for that.
Forced laptop mode: do not spin up, period. Keep offending processes in D-sleep unless I turn off this mode. Like there is a bomb instead of hard drive.
I also want to have access times tracked (mount -o atime), but I don't want the hard drive to be spinned up only to update them.
Is there some settings or kernel patches that can get closer to this?
May be I should write special io scheduler for "forced laptop mode"? E.g. echo suspend > /sys/block/sda/queue/scheduler to lock the drive and echo cfq > /ys/block/sda/queue/scheduler to unlock it again?