Re: ftruncate-mmap: pages are lost after writing to mmaped file.

From: Linus Torvalds
Date: Thu Mar 26 2009 - 19:10:23 EST




On Thu, 26 Mar 2009, Aneesh Kumar K.V wrote:
>
> >page faults doing allocation can take a
> > *long* time
>
> That is true

Btw, this is actually a feature rather than a bug.

We want to slow down the writer, which is why we also do dirty page
balancing when marking a page dirty.

Basically, if block allocation is a performance problem, then it should be
a performance problem that is attributed to the process that _causes_ it,
rather than to some random poor unrelated process that then later ends up
writing the page out because it wants to use some memory.

This is why tracking dirty pages is so important. Yes, it also avoids
various nasty overcommit situations, but the whole "make it hurt for the
person responsible, rather than a random innocent bystander" is the more
important part of it.

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/