Re: APM support for avoiding waking up laptops every few seconds?

Pavel Machek (
Sun, 3 Aug 1997 10:42:16 +0200

> It would be nice if the laptop feature to spin down the drive weren't
> nearly completely defeated by Unix's intelligent memory management. I
> know people have suggested (and implemented) disabling updating atime
> as a solution, but i think that would only help a little. Really, all
> disk activity should be avoided and delayed whenever the disk is spun
> down.
> Ideally what i would like to see would be,
> 1 Just before the APM spins down the disk, a sync should be done.
> Though i'm not actually sure there's any way to request such notice.
> 2 Whenever the disk is spun down sys_bdflush should be a noop
> The idea being that eventually a read will wake up the disk and all
> those dirty buffers will be flushed within five seconds. This will
> suck up a lot buffers but if the free list is empty refill_freelist
> will still work fine.

Hmm, this can be done in userland, and I did it in userland for ide
drives. I guess I'll have to publish it.

> 3 A lot better behaviour in keeping unused buffers around
> Currently if i run the same program repeatedly i still occasionally
> hear pages getting read. And if i run a program every 30s it has to
> be paged in every time.
> I realize the buffer architecture has changed in 2.1 hopefully it has
> improved on the last point.
> Incidentally if you're worried about buffers not being committed soon
> enough and users losing critical data, frankly, hearing the disk spin
> down is a pretty unambiguous interface indicating that if the machine
> panicked right that moment any writes would be lost. Users can always
> run `sync' if it's absolutely critical.
> greg

This is my little buggy signature...				Pavel
GCM d? s-: !g p?:+ au- a--@ w+ v- C++@ UL+++ L++ N++ E++ W--- M- Y- R+