linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Hugh Dickins <hugh@veritas.com>
To: Christoph Lameter <clameter@sgi.com>
Cc: akpm@osdl.org, linux-mm@kvack.org
Subject: Re: Page Migration: Make do_swap_page redo the fault
Date: Mon, 10 Apr 2006 19:54:01 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0604101933400.26478@blonde.wat.veritas.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0604090357350.5312@blonde.wat.veritas.com>

On Sun, 9 Apr 2006, Hugh Dickins wrote:
> On Sat, 8 Apr 2006, Christoph Lameter wrote:
> > 
> > Those two checks were added for migration together with the one we 
> > are removing now. Sounds like you think they additionally fix some other 
> > race conditions?
> 
> But I do have to worry then.  I'd missed the addition of those checks:
> if they really are necessary, then the rules have changed in two
> tricky areas I now need to re-understand.  It'll take me a while.

I have now checked through, and I'm relieved to conclude that neither
of those other two PageSwapCache rechecks are necessary; and the rules
are much as before.

In the try_to_unuse case, it's quite possible that !PageSwapCache there,
because of a racing delete_from_swap_cache; but that case is correctly
handled in the code that follows.

In the shmem_getpage case, info->lock is held to ensure that a racing
shmem_getpage or shmem_unuse_inode can't change it to !PageSwapCache.

In neither case can page migration interfere, because we're holding a
reference on the page: acquired within find_get_page's tree_lock (or
in the initial page allocation before add_to_swap_cache).

migrate_page_remove_references is careful to check page_count against
nr_refs within the tree_lock, and back out if page_count is raised.
If it didn't do so, most uses of find_get_page would be unsafe.

So I believe we can safely remove these other two
"Page migration has occured" blocks - can't we?

Hugh

--
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-10 18:54 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 [this message]
2006-04-10 20:19             ` Christoph Lameter
2006-04-11 14:58               ` Lee Schermerhorn
2006-04-11 15:55                 ` 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=Pine.LNX.4.64.0604101933400.26478@blonde.wat.veritas.com \
    --to=hugh@veritas.com \
    --cc=akpm@osdl.org \
    --cc=clameter@sgi.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