public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* laptop mode in 2.4.24
@ 2004-02-20 11:32 Cristiano De Michele
  2004-02-20 13:42 ` Kiko Piris
  0 siblings, 1 reply; 5+ messages in thread
From: Cristiano De Michele @ 2004-02-20 11:32 UTC (permalink / raw)
  To: linux-kernel

Hi,
I had kernel 2.4.22-ac4 + laptop mode patch 
and it worked perfectly.
Now I'm on a 2.4.24 kernel where the aforementioned
patch has been merged in, but it seems
that it does not work properly,
I've set bdflush as follows:

cat /proc/sys/vm/bdflush
30 500 0 0 60000 60000 60 20 0

cat /proc/sys/vm/laptop_mode
1

and using
echo "1" > cat /proc/sys/vm/block_dump

in syslog there are only such messages:

.
.
.
Feb 20 11:31:17 piro kernel: kjournald: WRITE block 46640/8 on 03:05
Feb 20 11:31:17 piro kernel: kjournald: WRITE block 46648/8 on 03:05
.
.
.

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

thx Cristiano

  
-- 
Cristiano De Michele <demichel@na.infn.it>
Department of Physics, University of Naples "Federico II"

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: laptop mode in 2.4.24
  2004-02-20 11:32 laptop mode in 2.4.24 Cristiano De Michele
@ 2004-02-20 13:42 ` Kiko Piris
  2004-02-20 19:15   ` Philippe Troin
  0 siblings, 1 reply; 5+ messages in thread
From: Kiko Piris @ 2004-02-20 13:42 UTC (permalink / raw)
  To: Cristiano De Michele; +Cc: linux-kernel

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.

-- 
Kiko

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: laptop mode in 2.4.24
  2004-02-20 13:42 ` Kiko Piris
@ 2004-02-20 19:15   ` Philippe Troin
  2004-02-21  4:02     ` Micha Feigin
  0 siblings, 1 reply; 5+ messages in thread
From: Philippe Troin @ 2004-02-20 19:15 UTC (permalink / raw)
  To: Kiko Piris; +Cc: Cristiano De Michele, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 582 bytes --]

Kiko Piris <kernel@pirispons.net> 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...


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: linux-2.4.24-09-laptop-mode.patch.bz2 --]
[-- Type: text/x-patch, Size: 690 bytes --]

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

[-- Attachment #3: Type: text/plain, Size: 7 bytes --]


Phil.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: laptop mode in 2.4.24
  2004-02-20 19:15   ` Philippe Troin
@ 2004-02-21  4:02     ` Micha Feigin
       [not found]       ` <20040221182921.GF1162@laptop.localdomain.>
  0 siblings, 1 reply; 5+ messages in thread
From: Micha Feigin @ 2004-02-21  4:02 UTC (permalink / raw)
  To: linux-kernel

On Fri, Feb 20, 2004 at 11:15:25AM -0800, Philippe Troin wrote:
> Kiko Piris <kernel@pirispons.net> 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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: laptop mode in 2.4.24
       [not found]       ` <20040221182921.GF1162@laptop.localdomain.>
@ 2004-02-24  1:46         ` Micha Feigin
  0 siblings, 0 replies; 5+ messages in thread
From: Micha Feigin @ 2004-02-24  1:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: Micha Feigin

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-02-24  1:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-20 11:32 laptop mode in 2.4.24 Cristiano De Michele
2004-02-20 13:42 ` Kiko Piris
2004-02-20 19:15   ` Philippe Troin
2004-02-21  4:02     ` Micha Feigin
     [not found]       ` <20040221182921.GF1162@laptop.localdomain.>
2004-02-24  1:46         ` Micha Feigin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox