Re: laptop mode in 2.4.24
From: Micha Feigin
Date: Fri Feb 20 2004 - 23:05:48 EST
On Fri, Feb 20, 2004 at 11:15:25AM -0800, Philippe Troin wrote:
> 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).
> >
Yes, there was a bug with the version included in the official kernel
that it updates the value in the wrong place.
> > You need to remount your filesystems with appropate commit option. You
> > can see the updated control script that's in 2.6.*-mm* trees.
>
There is one problem with the commit option that you have to reset the
default option manually because there is currently no reset option (you
need to change the script to do a commit=30 when leaving laptop mode).
> Or use this patch...
>
The problem with this patch is that it overrides the built in commit
option that existed before the laptop mode patch was introduced.
> 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.
-
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/