Re: [PATCH 4/4] anonvma: when setting up page->mapping, we need topick the _oldest_ anonvma

From: Rik van Riel
Date: Mon Apr 12 2010 - 17:04:34 EST


On 04/12/2010 04:23 PM, Linus Torvalds wrote:

From: Linus Torvalds<torvalds@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 12 Apr 2010 12:44:29 -0700
Subject: [PATCH 4/4] anonvma: when setting up page->mapping, we need to pick the _oldest_ anonvma

Otherwise we might be mapping in a page in a new mapping, but that page
(through the swapcache) would later be mapped into an old mapping too.
The page->mapping must be the case that works for everybody, not just
the mapping that happened to page it in first.

This can be improved in certain cases: if we know the page is private to
just this particular mapping (for example, it's a new page, or it is the
only swapcache entry), we could pick the top (most specific) anon_vma.

But that's a future optimization. Make it _work_ reliably first.

Agreed. I'll send an incremental for that later, you
can judge whether or not it's something you'll want to
merge before or after 2.6.34

Signed-off-by: Linus Torvalds<torvalds@xxxxxxxxxxxxxxxxxxxx>

Reviewed-by: Rik van Riel <riel@xxxxxxxxxx>
--
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/