[PATCH] bdi: use deferable timer for sync_supers task

From: Yong Wang
Date: Fri Oct 08 2010 - 04:57:24 EST


sync_supers task currently wakes up periodically for superblock
writeback. This hurts power on battery driven devices. This patch
turns this housekeeping timer into a deferable timer so that it
does not fire when system is really idle.

Signed-off-by: Yong Wang <yong.y.wang@xxxxxxxxx>
Signed-off-by: Xia Wu <xia.wu@xxxxxxxxx>
---
mm/backing-dev.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index 65d4204..9a8daa5 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -238,7 +238,9 @@ static int __init default_bdi_init(void)
sync_supers_tsk = kthread_run(bdi_sync_supers, NULL, "sync_supers");
BUG_ON(IS_ERR(sync_supers_tsk));

- setup_timer(&sync_supers_timer, sync_supers_timer_fn, 0);
+ init_timer_deferrable(&sync_supers_timer);
+ sync_supers_timer.function = sync_supers_timer_fn;
+ sync_supers_timer.data = 0;
bdi_arm_supers_timer();

err = bdi_init(&default_backing_dev_info);
--
1.5.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/