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

Christoph Lameter
2006-11-30T20:15:33Z

On Thu, 30 Nov 2006, Paul Menage wrote:

> > 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.

Right but pagecache pages are mapped differently by a mapping attached to
the inode. The vma does not vanish. We have to distinguish clearly between
anonymous and file based pages.

> > 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.

Hmmm.. Well talk to Hugh Dickins about that. anon_vmas are very
performance sensitive things.

> 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.

You cannot use page_lock_anon_vma since the mapcount is of the page is
zero. Something must be done before we reduce the mapcount to zero to
pin the vma.