Re: 2.6.xx: dirty pages never being sync'd to disk?

Arjan van de Ven
2005-11-14T15:35:53Z

On Mon, 2005-11-14 at 10:30 -0500, Mark Lord wrote:
> Okay, this one's been nagging me since I first began using 2.6.xx.
>
> My Notebook computer has 2GB of RAM, and the 2.6.xx kernel seems quite
> happy to leave hundreds of MB of dirty unsync'd pages laying around
> more or less indefinitely. This worries me, because that's a lot of data
> to lose should the kernel crash (which it has once quite recently)
> or the battery die.
>
> /proc/sys/vm/dirty_expire_centisecs = 3000 (30 seconds)
> /proc/sys/vm/dirty_writeback_centisecs = 500 (5 seconds)
>
> My understanding (please correct if wrong) is that this means
> that any (file data) page which is dirtied, should get flushed
> back to disk after 30 seconds or so.

do you have laptop mode enabled? That changes the behavior bigtime in
this regard and makes the kernel behave quite different.

also if these are files written to by mmap, the kernel only really sees
those as dirty when the mapping gets taken down (eg the propagation from
the pagetable dirty bit to the per page dirty bit goes a bit lazy)