linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Paul Menage" <menage@google.com>
To: Christoph Lameter <clameter@sgi.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	linux-mm@kvack.org, akpm@osdl.org,
	Hugh Dickins <hugh@veritas.com>
Subject: Re: [RFC][PATCH 0/1] Node-based reclaim/migration
Date: Thu, 30 Nov 2006 13:33:18 -0800	[thread overview]
Message-ID: <6599ad830611301333v48f2da03g747c088ed3b4ad60@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0611301211270.24331@schroedinger.engr.sgi.com>

On 11/30/06, Christoph Lameter <clameter@sgi.com> wrote:
>
> 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.

Let me clarify my proposal:

1) When gathering pages we find an anon page

2) We call page_lock_anon_vma(); if it returns NULL we ignore the page

3) If the anon_vma has an empty vma list, we ignore the page

4) We increment page_mapcount(); if this crosses the boundary from
unmapped to mapped, we know that we're racing with someone else;
either ignore the page or start again

5) If page->mapping no longer refers to our anon_vma, we know we're
racing; drop page_mapcount and ignore the page or start again

6) We increment anon_vma->migration_count to pin the anon_vma

At this point we know that the vma isn't going to go away since it's
pinned via the migration count, and any new users of the page will use
the pinned anon_vma since page_mapcount() is positive.

Paul

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2006-11-30 21:33 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-29  3:06 menage
2006-11-29  3:06 ` [RFC][PATCH 1/1] Expose per-node reclaim and migration to userspace menage
2006-11-29  6:07   ` Nick Piggin
2006-11-29 21:57     ` Paul Menage
2006-11-30  4:13       ` Christoph Lameter
2006-11-30  4:18         ` Paul Menage
2006-11-30  7:38       ` Nick Piggin
2006-11-30  7:57         ` Paul Menage
2006-11-30  8:26           ` Nick Piggin
2006-11-30  8:39             ` Paul Menage
2006-11-30  8:55               ` Nick Piggin
2006-11-30  9:06                 ` Paul Menage
2006-11-30  9:21                   ` Nick Piggin
2006-11-30  9:45                     ` Paul Menage
2006-11-30 10:15                       ` Nick Piggin
2006-11-30 10:40                         ` Paul Menage
2006-11-30 11:04                           ` Nick Piggin
2006-11-30 11:23                             ` Paul Menage
2006-11-30 11:35                               ` Nick Piggin
2006-11-30  0:18   ` KAMEZAWA Hiroyuki
2006-11-30  0:25     ` Paul Menage
2006-11-30  0:38       ` KAMEZAWA Hiroyuki
2006-11-30  4:15       ` Christoph Lameter
2006-11-30  4:10   ` Christoph Lameter
2006-11-30  0:31 ` [RFC][PATCH 0/1] Node-based reclaim/migration KAMEZAWA Hiroyuki
2006-11-30  0:31   ` Paul Menage
2006-11-30  4:11     ` KAMEZAWA Hiroyuki
2006-11-30  4:17     ` Christoph Lameter
2006-11-30 10:45       ` Paul Menage
2006-11-30 11:12         ` KAMEZAWA Hiroyuki
2006-11-30 11:25           ` Paul Menage
2006-11-30 12:18             ` KAMEZAWA Hiroyuki
2006-11-30 18:28             ` Christoph Lameter
2006-11-30 18:35               ` Paul Menage
2006-11-30 18:39                 ` Christoph Lameter
2006-11-30 19:09                   ` Paul Menage
2006-11-30 19:42                     ` Christoph Lameter
2006-11-30 19:53                       ` Paul Menage
2006-11-30 20:00                         ` Christoph Lameter
2006-11-30 20:07                           ` Paul Menage
2006-11-30 20:15                             ` Christoph Lameter
2006-11-30 21:33                               ` Paul Menage [this message]
2006-11-30 23:41                                 ` Christoph Lameter
2006-11-30 23:48                                   ` Paul Menage
2006-12-01  2:23                                     ` Christoph Lameter
2006-12-01 19:32                                       ` Paul Menage
2006-12-01 19:56                                         ` Christoph Lameter
2006-12-01  2:44                                     ` KAMEZAWA Hiroyuki
2006-12-01  2:43                                       ` Christoph Lameter
2006-12-01  2:59                                         ` KAMEZAWA Hiroyuki
2006-12-01  2:44                                       ` Christoph Lameter
2006-12-01  3:10                                         ` KAMEZAWA Hiroyuki
2006-12-01  5:28                                           ` Christoph Lameter
2006-11-30  4:04 ` Christoph Lameter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6599ad830611301333v48f2da03g747c088ed3b4ad60@mail.gmail.com \
    --to=menage@google.com \
    --cc=akpm@osdl.org \
    --cc=clameter@sgi.com \
    --cc=hugh@veritas.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox