Re: laptop mode in 2.4.24

From: Micha Feigin
Date: Mon Feb 23 2004 - 20:48:48 EST


On Sat, Feb 21, 2004 at 01:29:21PM -0500, Eric Hustvedt wrote:
> On Sat, 21 Feb 2004, Micha Feigin wrote:
>
> > 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. */
>
> What about changing the logic to use the greater of get_buffer_flushtime() or
> j_commit_interval when laptop_mode is enabled? If laptop_mode is disabled,
> j_commit_interval can be used, as it is currently.
>
> I don't have my kernel dev trees on this computer, but I can whip up a patch,
> if people are interested.
>

Considering that this was somewhat of a dirty hack in the first place,
that ext3 already has the functionality through the commit mount option
and that 2.6 laptop mode I think the proper way would be to throw this
out and use the commit option instead. All it needs is the reset option
(use commit=0 to use the default file system value). This way among
other things it will be possible to use the same laptop mode script for
both 2.4 and 2.6.
I have a patch for that which is in a testing phase now (along with a
fix for reiserfs and xfs), I am a bit slow on it now due to test season
but I am hoping to publish it next week or something around that. I
will check with the guy doing the 2.6 laptop-mode patch to see whats
the state of the testing.

> -Eric


-
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/