linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Lameter <clameter@sgi.com>
To: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
Cc: Hugh Dickins <hugh@veritas.com>, akpm@osdl.org, linux-mm@kvack.org
Subject: Re: Page Migration: Make do_swap_page redo the fault
Date: Tue, 11 Apr 2006 08:55:29 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0604110842140.32343@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <1144767501.5160.12.camel@localhost.localdomain>

On Tue, 11 Apr 2006, Lee Schermerhorn wrote:

> > Hmmm... The increased count is also an argument against having to check 
> > for the race in do_swap_page(). So maybe Lee's lazy migration patchset 
> > should also be fine without these checks and there is actually no need
> > to rely on the ptes not being the same.
> 
> May still be some work in do_swap_page().  The unmap has already
> occurred.  In the general case [support for migrating pages w/ > 1 pte
> mapping], two or more tasks could race faulting the cache pte.  IMO one
> should perform the migration [replacing old page in cache with new
> page], others should block and then use the new page to resolve their
> own faults.  I think this means a check and then at least another cache
> lookup.  Maybe redo the fault, as Christoph has said.
> 
> Don't know about direct migration.

In direct migration the reference counts avoid these problems. 

The worst case scenario that we have imagined so far assumed that 
migration occurs after do_swap_cache has done a lookup of the old page in 
the swap_cache. The check that we had in there was envisioned to protect 
against the case of migration happening after the lookup_swap_cache() 
occurred.

As Hugh noted: lookup_swap_cache() is increasing the page count under 
tree_lock. direct migration also checks page count under the tree lock.

So migration cannot occur after the lookup_swap_cache() has been done and 
returned the old page.

If lookup_swap_cache returns the new page then we will block on 
lock_page() until migration has finished.


--
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-04-11 15:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-04  5:33 Christoph Lameter
2006-04-08 12:16 ` Hugh Dickins
2006-04-08 18:25   ` Christoph Lameter
2006-04-08 19:26     ` Hugh Dickins
2006-04-08 21:39       ` Christoph Lameter
2006-04-09  3:11         ` Hugh Dickins
2006-04-10 18:54           ` Hugh Dickins
2006-04-10 20:19             ` Christoph Lameter
2006-04-11 14:58               ` Lee Schermerhorn
2006-04-11 15:55                 ` Christoph Lameter [this message]

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=Pine.LNX.4.64.0604110842140.32343@schroedinger.engr.sgi.com \
    --to=clameter@sgi.com \
    --cc=Lee.Schermerhorn@hp.com \
    --cc=akpm@osdl.org \
    --cc=hugh@veritas.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