Hi guys, Even though I don't own a laptop, I find it very irritating that my hard drive is active so much. Wanting to fix this, I found the Jens Axboe's "laptop-mode" patch. Unfortunately it hadn't been ported to Linux 2.6.0 yet, and I'm using that as my primary kernel now. I gave porting it a shot, and here is the result. I'm running it right now, and my hard drive has been spun down for the complete time I have been writing this message. Still, I'm not sure whether it really works as advertised. :) The reason is that my PC is also a mail server for my personal e-mail, and I receive e-mails more than once every 10 minutes (fscking spam!). Still, the tests that I've done seem to indicate that it works. I've done some things differently than in Jens's patch (my port is based on v4 of the patch BTW): * The block dirtying reporting is not there. As an alternative, you can write a number N higher than 1 into /proc/sys/vm/laptop_mode, which will give you reports on N-1 actual read/write operations, including the pid+command that caused them. This gives you a way to put a reasonable bound on the number of messages you're going to get. You're only interested in the first one (the one that spins up your disk) anyway. The messages look like this: ll_rw_block: (107 reports left) READ requested by imapd (pid 1137) * When laptop mode is on, wb_kupdate() also performs all of the other actions mentioned in do_sync(). I don't know whether this is really necessary because I don't know the full implications of all those actions, but at least it REALLY makes sure that everything is synced. * The script writes to different values in /proc/sys/vm, because the Linux 2.6 VM has different controls. * The patch does not modify the ext3 journal commit timeout; you have to mount your filesystem with commit=600 (or whatever your preferred value is) to get the correct effect. The 2.4 patch modified the expiration of an ext3 transaction, I've removed this as I don't see the use if you're going to have to mount the fs with "commit=" anyway. The default expiration time of an ext3 transaction is equal to the commit interval, which is very reasonable. Usually you'd set your commit interval to the same as the dirty_writeback_centisecs value (in seconds, then), so it would boil down to the same thing. Disclaimer: I'm not a very experienced kernel developer, and I may have made mistakes. Don't kill me if it doesn't work. :) I'd appreciate some feedback, so if it works or doesn't work for you, please let me know! Bart Samwel