Re: laptop mode in 2.4.24

From: Philippe Troin
Date: Fri Feb 20 2004 - 14:54:06 EST


Kiko Piris <kernel@xxxxxxxxxxxxx> writes:

> On 20/02/2004 at 12:32, Cristiano De Michele wrote:
>
> > that is only journaling is writing to my HD
> > and anyway every minute more or less something
> > gets written to HD preventing it from being spinned down
>
> IIRC, laptop-mode included in mainline 2.4 does not reset commit
> interval of ext3 filesystems (as surely did the patch you applied to
> older kernels).
>
> You need to remount your filesystems with appropate commit option. You
> can see the updated control script that's in 2.6.*-mm* trees.

Or use this patch...

diff -ruN linux-2.4.24.orig/fs/jbd/transaction.c linux-2.4.24/fs/jbd/transaction.c
--- linux-2.4.24.orig/fs/jbd/transaction.c Fri Nov 28 10:26:21 2003
+++ linux-2.4.24/fs/jbd/transaction.c Mon Jan 12 12:01:54 2004
@@ -56,7 +56,11 @@
transaction->t_journal = journal;
transaction->t_state = T_RUNNING;
transaction->t_tid = journal->j_transaction_sequence++;
- transaction->t_expires = jiffies + journal->j_commit_interval;
+ /*
+ * have to do it here, otherwise changed age_buffers since boot
+ * wont have any effect
+ */
+ transaction->t_expires = jiffies + get_buffer_flushtime();
INIT_LIST_HEAD(&transaction->t_jcb);

/* Set up the commit timer for the new transaction. */

Phil.