From 6662c9f80bc8e914e826a009cdf0755d442687c8 Mon Sep 17 00:00:00 2001 From: Victor Lowther Date: Sat, 28 Jun 2008 11:38:28 -0500 Subject: 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. --- pm/power.d/harddrive | 9 +++++---- pm/power.d/laptop-mode | 2 +- 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 } -- cgit v1.2.3