Linux: Laptop Mode Merged Into Stable Kernel

Submitted by Jeremy
on October 11, 2003 - 8:15pm

The recent 2.4.23-pre7 kernel [story] included Jens Axboe's "laptop mode" patch [story]. This patch can increase battery lifetime on laptops by intelligently batching reads and writes to and from disk. This prolongs battery life by minimizing how often a laptop's drive has to spin up.

Around the time the patch was merged into the stable 2.4 kernel, it was pointed out that Red Hat removed it from their tree. In the following discussion, Jens explains why it is extremely unlikely that the patch could be the source of Red Hat's problems. Dave Jones [interview], who works at RedHat, concured, "Laptop mode is likely fine, the problem we've seen is very likely caused by the AAM counterpart."

Jens also wrote the AAM patch, or "Automatic Acoustic Management", allowing a computer to automatically switch between three disk modes: idle, or complete spin down; slow, performing slower quieter seeks with less power; and fast, performing faster louder seeks with more power. Dave further acknowledged that perhaps the problem is neither AAM nor "laptop mode", "There are still 1-2 other small patches against IDE which could be the reason."


From: Jeff Garzik [email blocked]
To: Linux Kernel Mailing List
Subject: Re: [PATCH] laptop mode
Date: Thu, 09 Oct 2003 10:02:38 -0400

Linux Kernel Mailing List wrote:
> ChangeSet 1.1150.1.52, 2003/10/08 10:49:45-03:00, [email blocked]
> 
> 	[PATCH] laptop mode
> 	
> 	Hi Marcelo,
> 	
> 	Lots of people have been using this patch with great success, and it's
> 	been in the SuSE kernel for some months now too. It is also in the -benh
> 	ppc tree
> 	
> 	Basically, it introduces a write back mode of dirty and journal data
> 	that is more suitable for laptops. At the block layer end, it schedules
> 	write out of dirty data after the disk has been idle for 5 seconds.
> 	
> 	Laptop mode can be switched on and off with /proc/sys/vm/laptop_mode.
> 	There is also a block_dump sysctl, which if enabled will dump who
> 	dirties and writes out data. This is very helpful in pinning down who is
> 	causing unnecessary writes to the disk.

Red Hat just dropped this patch since it was suspected of data 
corruption ;-(

	Jeff


From: Marcelo Tosatti <marcelo.tosatti@cyclades.com> Subject: Re: [PATCH] laptop mode Date: Thu, 9 Oct 2003 11:09:35 -0300 (BRT) On Thu, 9 Oct 2003, Jeff Garzik wrote: > > Red Hat just dropped this patch since it was suspected of data > corruption ;-( Uh, oh... Jens?
From: Jens Axboe [email blocked] Subject: Re: [PATCH] laptop mode Date: Thu, 9 Oct 2003 16:11:43 +0200 On Thu, Oct 09 2003, Marcelo Tosatti wrote: > > Uh, oh... Jens? See my previous mail. I don't see any problems with it, and I've certainly not heard of (or experienced myself) problems with the patch. I'm waiting for Jeff to expand on his mail, surely he/RH must know more about this issue. -- Jens Axboe
From: Jeff Garzik [email blocked] Subject: Re: [PATCH] laptop mode Date: Thu, 09 Oct 2003 10:18:15 -0400 Jens Axboe wrote: > > See my previous mail. I don't see any problems with it, and I've > certainly not heard of (or experienced myself) problems with the patch. > I'm waiting for Jeff to expand on his mail, surely he/RH must know more > about this issue. That's 100% of my knowledge. Talk to arjan/davej/sct for more info... That's what RH's field testing showed us, ignore it if you wish... :) Jeff
From: Jens Axboe [email blocked] Subject: Re: [PATCH] laptop mode Date: Thu, 9 Oct 2003 16:21:48 +0200 On Thu, Oct 09 2003, Jeff Garzik wrote: > > That's 100% of my knowledge. Talk to arjan/davej/sct for more info... CC'ed > That's what RH's field testing showed us, ignore it if you wish... :) As far as I can tell, laptop-mode cannot cause any corruption on it own that cannot otherwise happen without laptop mode. So if you see corruption, it is most likely exposing some other bug. Or the field users run out of battery and 10 minutes of work goes down the drain, that's a calcuated risk though. -- Jens Axboe
From: Dave Jones [email blocked] Subject: Re: [PATCH] laptop mode Date: Thu, 9 Oct 2003 15:28:04 +0100 On Thu, Oct 09, 2003 at 04:11:43PM +0200, Jens Axboe wrote: > > > Red Hat just dropped this patch since it was suspected of data > > > corruption ;-( > > > > Uh, oh... Jens? > > See my previous mail. I don't see any problems with it, and I've > certainly not heard of (or experienced myself) problems with the patch. > I'm waiting for Jeff to expand on his mail, surely he/RH must know more > about this issue. Laptop mode is likely fine, the problem we've seen is very likely caused by the AAM counterpart. Dave -- Dave Jones http://www.codemonkey.org.uk
From: Jens Axboe [email blocked] Subject: Re: [PATCH] laptop mode Date: Thu, 9 Oct 2003 16:05:47 +0200 On Thu, Oct 09 2003, Jeff Garzik wrote: > > Red Hat just dropped this patch since it was suspected of data > corruption ;-( Eh? Care to explain a bit further? I'm not aware of any data corruption issues there, and it's certainly simple enough to easily audit. And how kind of Red Hat to not inform me of any suspicion in this regard. -- Jens Axboe
From: Dave Jones [email blocked] Subject: Re: [PATCH] laptop mode Date: Thu, 9 Oct 2003 15:17:36 +0100 On Thu, Oct 09, 2003 at 04:05:47PM +0200, Jens Axboe wrote: > Eh? Care to explain a bit further? I'm not aware of any data corruption > issues there, and it's certainly simple enough to easily audit. 3-4 cases of random data corruption, all using Quantum Fireball drives, all with different IDE chipsets. > And how kind of Red Hat to not inform me of any suspicion in this > regard. I want to get facts right before crying wolf. Right now laptopmode/aam is just a suspect. There are still 1-2 other small patches against IDE which could be the reason. We've dropped laptopmode/aam for the time being to see if the folks seeing repeatable corruption suddenly start behaving again. Dave -- Dave Jones http://www.codemonkey.org.uk
From: Jens Axboe [email blocked] Subject: Re: [PATCH] laptop mode Date: Thu, 9 Oct 2003 16:26:32 +0200 On Thu, Oct 09 2003, Dave Jones wrote: > > I want to get facts right before crying wolf. Fair enough. > Right now laptopmode/aam is just a suspect. There are still 1-2 other > small patches against IDE which could be the reason. We've dropped > laptopmode/aam for the time being to see if the folks seeing repeatable > corruption suddenly start behaving again. aam patch is far more risky, it's a far more likely suspect. That patch never reall did go out of beta. Dropping laptop-mode and aam at the same time is bad engineering practice :). laptop-mode cannot cause corruption that cannot show otherwise. -- Jens Axboe
From: Pavel Machek [email blocked] Subject: Re: [PATCH] laptop mode Date: Sat, 11 Oct 2003 13:49:14 +0200 Hi! > aam patch is far more risky, it's a far more likely suspect. That patch > never reall did go out of beta. Dropping laptop-mode and aam at the same > time is bad engineering practice :). > > laptop-mode cannot cause corruption that cannot show otherwise. Well, if fireballs have data-corrupting that happens just after spinup (for example), I can see how laptop-mode affects that. W/o laptop-mode, disk is spinning all the time so sleep bugs can not manifest themselves. You add laptop-mode, and... Pavel -- When do you have a heart between your knees? [Johanka's followup: and *two* hearts?]
From: Jens Axboe [email blocked] Subject: Re: [PATCH] laptop mode Date: Sat, 11 Oct 2003 15:59:43 +0200 On Sat, Oct 11 2003, Pavel Machek wrote: > > Well, if fireballs have data-corrupting that happens just after spinup > (for example), I can see how laptop-mode affects that. W/o > laptop-mode, disk is spinning all the time so sleep bugs can not > manifest themselves. You add laptop-mode, and... Not very likely, imho. People have been using spin down with hdparm for years (in Linux and elsewhere), while acoustic management is a bit more esoteric. -- Jens Axboe

Related Links:

It wasn't pre6 but pre7...

Mind Booster Noori
on
October 12, 2003 - 4:02pm

It wasn't pre6 but pre7...

re: It wasn't pre6 but pre7...

Jeremy
on
October 12, 2003 - 5:33pm

It wasn't pre6 but pre7...

Indeed! Thanks... fixed.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.