Subject: 'laptop mode' on Linux
To: None <tech-kern@netbsd.org>
From: Steven M. Bellovin <smb@cs.columbia.edu>
List: tech-kern
Date: 04/03/2006 21:14:32
Recently, I've been reading (and reading about) the Linux kernel.
There's a variable called laptop_mode that controls some of the buffer
cache mechanism -- which, if I understand it correctly, is similar to
our unified buffer cache.

Anyway -- if in laptop mode, dirty pages are not normally flushed to
the disk, to avoid spinning it up.  On the other hand, normally dirty
page flushing is rate-limited, to avoid tying up the disk; in laptop
mode, however, if something is going to be flushed -- and hence the
disk spun up -- all dirty pages are written then, regardless of their
number.

So -- does NetBSD have something like that?  Should it?  How hard would
it be to implement?  (As best I can tell, laptop_mode is set via sysctl
on Linux.)

		--Steven M. Bellovin, http://www.cs.columbia.edu/~smb