Subject: Re: 'laptop mode' on Linux
To: Steven M. Bellovin <smb@cs.columbia.edu>
From: Bill Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 04/04/2006 12:16:11
--CdrF4e02JqNVZeln
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Apr 03, 2006 at 09:14:32PM -0400, Steven M. Bellovin wrote:
> 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.
>=20
> 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.
>=20
> 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.)

NetBSD doesn't have something like that, but I personally think it should.=
=20
:-)

I think both the idea of paced write-back to the disk and strong measures=
=20
to not spin up the disk are good.

Our current write-back algorithms are very lame, and could use work.

Take care,

Bill

--CdrF4e02JqNVZeln
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (NetBSD)

iD4DBQFEMsX7Wz+3JHUci9cRAmjFAJEBSO4ARhONAwxDIWqWAyVUrT81AJ9iwKsB
IFtuIMk0sHm0ug0UIdTAAA==
=G0va
-----END PGP SIGNATURE-----

--CdrF4e02JqNVZeln--