summaryrefslogtreecommitdiff
path: root/pm
diff options
context:
space:
mode:
authorVictor Lowther <victor.lowther@gmail.com>2008-06-28 11:38:28 -0500
committerVictor Lowther <victor.lowther@gmail.com>2010-06-05 13:32:49 -0500
commit6662c9f80bc8e914e826a009cdf0755d442687c8 (patch)
tree379c5c34d925b935682e878bcd8ba39d6348178f /pm
parent1ab9f81812861c9fbab59c53a1fd50b3077d6a0f (diff)
Richard raised concerns about hard drive spindown.
So the harddrive hook no longer tries to spin the drive down pending some sort of consensus on the right thing to do to make the hard drive save power. In the mean time, though, just flat-out disable write caching on the hard drive. I know that there are barriers and flushes that the ATA layer uses to ensure that data really is written to the disk, but hard drive cache isn't battery backed.
Diffstat (limited to 'pm')
-rw-r--r--pm/power.d/harddrive9
-rw-r--r--pm/power.d/laptop-mode2
2 files changed, 6 insertions, 5 deletions
diff --git a/pm/power.d/harddrive b/pm/power.d/harddrive
index cdfa637..604f2ca 100644
--- a/pm/power.d/harddrive
+++ b/pm/power.d/harddrive
@@ -4,15 +4,16 @@
harddrive_ac () {
for dev in /dev/[hs]d[a-z]; do
- #enable write caching, do not spin down the drive.
- hdparm -W 1 -S 0 $dev
+ # disable write caching, do not spin down the drive, disable APM
+ # and acoustic management, and sync everything to drive.
+ hdparm -W 0 -S 0 -B 254 -M 254 -f -F $dev
done
}
harddrive_battery() {
for dev in /dev/[hs]d[a-z]; do
- # disable write caching, spin down after 30 seconds
- hdparm -W 0 -S 6 $dev
+ # disable write caching, enable acoustic management
+ hdparm -W 0 -M 128 $dev
done
}
diff --git a/pm/power.d/laptop-mode b/pm/power.d/laptop-mode
index 8e0fbdf..0e35f67 100644
--- a/pm/power.d/laptop-mode
+++ b/pm/power.d/laptop-mode
@@ -16,7 +16,7 @@ laptop_mode_battery() {
echo 1 >$VM/laptop_mode
echo 1 >$VM/dirty_background_ratio
echo 60000 >$VM/dirty_expire_centisecs
- echo 60 >$VM/dirty_ratio
+ echo 85 >$VM/dirty_ratio
echo 60000 >$VM/dirty_writeback_centisecs
}