Skip to contentSkip to conversation

laptop mode

PATCH Jeff Garzik 7 participants 15 messages Oct 9, 2003 – Oct 18, 2003 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 10 lines · Linux Kernel Mailing List

ChangeSet 1.1150.1.52, 2003/10/08 10:49:45-03:00, [email protected]

[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

Quoted 8 lines

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

#2 lore raw
Quoted 18 lines · Jeff Garzik
Quoted 17 lines · Linux Kernel Mailing List

ChangeSet 1.1150.1.52, 2003/10/08 10:49:45-03:00, [email protected]

[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.

Quoted 8 lines
Quoted 5 lines

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 ;-(

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.

Signature · 1 line
Jens Axboe
#3 lore raw
Quoted 4 lines · Jens Axboe
Quoted 2 lines

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.

3-4 cases of random data corruption, all using Quantum Fireball drives, all with different IDE chipsets.

Quoted 2 lines

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

Signature · 1 line
 Dave Jones     http://www.codemonkey.org.uk
#4 lore raw
Quoted 7 lines · Dave Jones
Quoted 4 lines · Jens Axboe
Quoted 2 lines

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.

Quoted 7 lines

3-4 cases of random data corruption, all using Quantum Fireball drives, all with different IDE chipsets.

Quoted 2 lines

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.

Fair enough.

Quoted 4 lines

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.

Signature · 1 line
Jens Axboe
#5 lore raw

Hi!

Quoted 10 lines
Quoted 4 lines

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.

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

Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
#6 lore raw
Quoted 11 lines · Pavel Machek

Hi!

Quoted 9 lines
Quoted 4 lines

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 :).

Quoted 6 lines
Quoted 1 line

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

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.

Signature · 1 line
Jens Axboe
#7 lore raw
Quoted 3 lines · Jens Axboe

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.

I'm having trouble finding this on Google now, but I've heard rumors over the years of old Fireball drives corrupting data if they receive write commands too soon after spinning up (i.e., the drive doesn't bother waiting to spin up fully first). Maybe I'm not remembering the details correctly, but it was something about the drive trying to act on commands before it was fully spun up and malfunctioning as a result.

-Barry K. Nathan <[email protected]>

#8 lore raw
Quoted 7 lines · Barry K. Nathan
Quoted 3 lines · Jens Axboe

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.

Quoted 6 lines

I'm having trouble finding this on Google now, but I've heard rumors over the years of old Fireball drives corrupting data if they receive write commands too soon after spinning up (i.e., the drive doesn't bother waiting to spin up fully first). Maybe I'm not remembering the details correctly, but it was something about the drive trying to act on commands before it was fully spun up and malfunctioning as a result.

Well, there exists devices which comply with the delayed spin-up part of ATA/ATAPI specification... maybe our code doesn't cover that. I don't put much stock in rumors, but they are occasionally clues... :)

Jeff

#9 lore raw
In reply to Jeff Garzik
Quoted 15 lines · Jeff Garzik
Quoted 14 lines · Linux Kernel Mailing List

ChangeSet 1.1150.1.52, 2003/10/08 10:49:45-03:00, [email protected]

[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.

Quoted 7 lines
Quoted 4 lines

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 ;-(

Uh, oh... Jens?

#10 lore raw
Quoted 24 lines · Marcelo Tosatti
Quoted 20 lines · Jeff Garzik
Quoted 18 lines · Linux Kernel Mailing List

ChangeSet 1.1150.1.52, 2003/10/08 10:49:45-03:00, [email protected]

[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.

Quoted 4 lines
Quoted 2 lines

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.

Signature · 1 line
Jens Axboe
#11 lore raw
Quoted 29 lines · Jens Axboe
Quoted 27 lines · Marcelo Tosatti
Quoted 22 lines · Jeff Garzik
Quoted 10 lines · Linux Kernel Mailing List

ChangeSet 1.1150.1.52, 2003/10/08 10:49:45-03:00, [email protected]

[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

Quoted 8 lines

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 ;-(

Quoted 7 lines
Quoted 1 line

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.

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

#12 lore raw
Quoted 38 lines · Jeff Garzik
Quoted 37 lines · Jens Axboe
Quoted 33 lines · Marcelo Tosatti
Quoted 19 lines · Jeff Garzik
Quoted 17 lines · Linux Kernel Mailing List

ChangeSet 1.1150.1.52, 2003/10/08 10:49:45-03:00, [email protected]

[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.

Quoted 8 lines
Quoted 5 lines

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 ;-(

Uh, oh... Jens?

Quoted 7 lines
Quoted 4 lines

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

CC'ed

Quoted 1 line

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.

Signature · 1 line
Jens Axboe
#13 lore raw
In reply to Jens Axboe
Quoted 9 lines · Jens Axboe
Quoted 4 lines
Quoted 2 lines

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

Signature · 1 line
 Dave Jones     http://www.codemonkey.org.uk
#14 lore raw
In reply to Jens Axboe
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Jens" == Jens Axboe <[email protected]> writes:

Quoted 16 lines · Marcelo Tosatti
Quoted 1 line · Jeff Garzik
Quoted 14 lines · Linux Kernel Mailing List

ChangeSet 1.1150.1.52, 2003/10/08 10:49:45-03:00, [email protected]
[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.

Quoted 10 lines
Quoted 5 lines

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 ;-(

Quoted 2 lines

Uh, oh... Jens?

Jens> See my previous mail. I don't see any problems with it, and I've Jens> certainly not heard of (or experienced myself) problems with the Jens> patch. I'm waiting for Jeff to expand on his mail, surely he/RH Jens> must know more about this issue.

FWIW, I've been using laptop-mode for a long time now, with no problems whatsoever. It's a great addition and really helps laptop users.

On a related note, a very desirable feature would be to be able to trace which processes do I/O. Unfortunately, Linux distributions aren't very well adapted to laptops and many applications are way too "trigger-happy" when it comes to hard drive accesses. I guess most developers don't use laptops and just assume that they can write or read data at will. It is very difficult to trace the culprits when your HD light goes on every couple of seconds.

--J.

#15 lore raw
Quoted 29 lines · Jan Rychter
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Jens" == Jens Axboe <[email protected]> writes:

Quoted 16 lines · Marcelo Tosatti
Quoted 1 line · Jeff Garzik
Quoted 14 lines · Linux Kernel Mailing List

ChangeSet 1.1150.1.52, 2003/10/08 10:49:45-03:00, [email protected]
[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.

Quoted 10 lines
Quoted 5 lines

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 ;-(

Quoted 2 lines

Uh, oh... Jens?

Quoted 7 lines

Jens> See my previous mail. I don't see any problems with it, and I've Jens> certainly not heard of (or experienced myself) problems with the Jens> patch. I'm waiting for Jeff to expand on his mail, surely he/RH Jens> must know more about this issue.

FWIW, I've been using laptop-mode for a long time now, with no problems whatsoever. It's a great addition and really helps laptop users.

Glad to hear that.

Quoted 7 lines

On a related note, a very desirable feature would be to be able to trace which processes do I/O. Unfortunately, Linux distributions aren't very well adapted to laptops and many applications are way too "trigger-happy" when it comes to hard drive accesses. I guess most developers don't use laptops and just assume that they can write or read data at will. It is very difficult to trace the culprits when your HD light goes on every couple of seconds.

You do know that the laptop-mode patch included a feature to help with just that very problem, block_dump? If you do

echo "1" > /proc/sys/vm/block_dump

(shut down klogd first), it will tell you which process caused the hd activity, either directly or by dirtying a page of data.

Signature · 1 line
Jens Axboe