Re: [RFC][PATCH 0/1] Node-based reclaim/migration

Christoph Lameter
2006-12-01T02:23:40Z

On Thu, 30 Nov 2006, Paul Menage wrote:

> Don't we need to bump the mapcount? If we don't, then the page gets
> unmapped by the migration prep, and if we race with anyone trying to
> map it they may allocate a new anon_vma and replace it.

Allocate a new vma for an existing anon page? That never happens. We may
do COW in which case the page is copied.

> > + empty = list_empty(&anon_vma->head);
>
> I think we need to check for migration_count being non-zero here, just
> in case two processes try to migrate the same page at once. Or maybe
> just say that if migration_count is non-zero, the second migrator just
> ignores the page?

Right we need to check for the migration_count being zero. The one that
zeros it must free the anon_vma.