summaryrefslogtreecommitdiff
path: root/pm
diff options
context:
space:
mode:
authorVictor Lowther <victor.lowther@gmail.com>2008-06-28 23:25:11 -0500
committerVictor Lowther <victor.lowther@gmail.com>2010-06-05 13:32:49 -0500
commit8aae17379df8772e46b0f28fdb4d3e974f65ad54 (patch)
treeb59bf79b6b857ae2ebcbad5386ae451f4d6189ae /pm
parent6662c9f80bc8e914e826a009cdf0755d442687c8 (diff)
Added some explanatory comments to the power hooks.
Diffstat (limited to 'pm')
-rw-r--r--pm/power.d/laptop-mode3
-rw-r--r--pm/power.d/readahead4
-rw-r--r--pm/power.d/xfs_buffer2
3 files changed, 9 insertions, 0 deletions
diff --git a/pm/power.d/laptop-mode b/pm/power.d/laptop-mode
index 0e35f67..52a8452 100644
--- a/pm/power.d/laptop-mode
+++ b/pm/power.d/laptop-mode
@@ -5,6 +5,7 @@ VM="/proc/sys/vm"
[ -f $VM/laptop_mode -a -f $VM/dirty_ratio ] || exit $NA
laptop_mode_ac() {
+ # disable laptop mode, set vm parameters back to sane defaults
echo 0 >$VM/laptop_mode
echo 5 >$VM/dirty_background_ratio
echo 2999 >$VM/dirty_expire_centisecs
@@ -13,6 +14,8 @@ laptop_mode_ac() {
}
laptop_mode_battery() {
+ # enable laptop mode, set vm parameters to buffer as many writes as
+ # possible.
echo 1 >$VM/laptop_mode
echo 1 >$VM/dirty_background_ratio
echo 60000 >$VM/dirty_expire_centisecs
diff --git a/pm/power.d/readahead b/pm/power.d/readahead
index 4247217..c61ce43 100644
--- a/pm/power.d/readahead
+++ b/pm/power.d/readahead
@@ -3,6 +3,10 @@
[ -x /sbin/blockdev ] || exit $NA
readahead() {
+ # the intent here is to iterate through all filesystems
+ # mounted on a local block device. It Works For The Maintainer(tm).
+ # More sophistication in figuring out what exactly is a local block device
+ # would be welcome.
for dev in $(awk '/^\/dev\// {print $1}'</etc/mtab); do
/sbin/blockdev --setfra $1 "$dev"
done
diff --git a/pm/power.d/xfs_buffer b/pm/power.d/xfs_buffer
index 7510e68..ec8a248 100644
--- a/pm/power.d/xfs_buffer
+++ b/pm/power.d/xfs_buffer
@@ -7,12 +7,14 @@ XFS="/proc/sys/fs/xfs"
xfs_ac() {
+ # don't buffer so much, flush data out regularly.
echo 1500 >$XFS/age_buffer_centisecs
echo 3000 >$XFS/xfssyncd_centisecs
echo 100 >$XFS/xfsbufd_centisecs
}
xfs_battery() {
+ # buffer lots
echo 60000 >$XFS/age_buffer_centisecs
echo 60000 >$XFS/xfssyncd_centisecs
echo 3000 >$XFS/xfsbufd_centisecs