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

Paul Menage
2006-11-30T20:07:20Z

On 11/30/06, Christoph Lameter <clameter@sgi.com> wrote:
> >
> > Why is that a problem? If the vma has gone away, then there's no need
> > to reestablish the pte. And remove_file_migration_ptes() appears to be
> > adequately protected against races with unlink_file_vma() since they
> > both take i_mmap_sem.
>
> We are talking about anonymous pages here.

No, I was talking about pagecache pages by this point - you'd
mentioned them as the case where page_mapcount() can be 0 for a long
period of time.

> You cannot figure out
> that the vma is gone since that was the only connection to the process.
> Hmm... Not true we still have a migration pte in that processes space. But
> we cannot find the process without the anon_vma.

What did you think of the approach that I proposed of adding a
migration count to anon_vma? unlink_anon_vma() doesn't free the
anon_vma if migration count is non-zero.

When gathering pages for migration, we use page_lock_anon_vma() to get
the anon_vma; if it returns NULL or has an empty vma list we skip the
page, else we bump migration count (and mapcount?) by 1 and unlock.
That will guarantee that the anon_vma sticks around until the end of
the migration.

Paul