linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Lameter <clameter@engr.sgi.com>
To: akpm@osdl.org
Cc: linux-mm@kvack.org, Hugh Dickins <hugh@veritas.com>
Subject: page_lock_anon_vma(): remove check for mapped page
Date: Fri, 24 Feb 2006 17:03:20 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0602241658030.24668@schroedinger.engr.sgi.com> (raw)

Any reason that this function is checking for a mapped page? There could
be references through a swap pte to the page. The looping in
remove_from_swap, page_referenced_anon and try_to_unmap anon would 
work even if the check for a mapped page would be removed.

I have sent the patch below today to Hugh Dickins but did not receive an 
answer. Probaby requires some discussion.



It is okay to obtain a anon vma lock for a page that is only mapped
via a swap pte to the page. This occurs frequently during page
migration. The check for a mapped page (requiring regular ptes pointing
to the page) gets in the way.

Without this patch anonymous pages will have swap ptes after migration
that then need to be converted into regular ptes via a page fault.

Signed-off-by: Christoph Lameter <clameter@sgi.com>

Index: linux-2.6.16-rc4/mm/rmap.c
===================================================================
--- linux-2.6.16-rc4.orig/mm/rmap.c	2006-02-17 14:23:45.000000000 -0800
+++ linux-2.6.16-rc4/mm/rmap.c	2006-02-24 13:19:11.000000000 -0800
@@ -196,8 +196,6 @@ static struct anon_vma *page_lock_anon_v
 	anon_mapping = (unsigned long) page->mapping;
 	if (!(anon_mapping & PAGE_MAPPING_ANON))
 		goto out;
-	if (!page_mapped(page))
-		goto out;
 
 	anon_vma = (struct anon_vma *) (anon_mapping - PAGE_MAPPING_ANON);
 	spin_lock(&anon_vma->lock);

--
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-02-25  1:03 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-25  1:03 Christoph Lameter [this message]
2006-02-25 14:01 ` Hugh Dickins
2006-02-26  4:42   ` Hugh Dickins
2006-02-26  5:26     ` Christoph Lameter
2006-02-26 15:58       ` Hugh Dickins
2006-02-27 15:47         ` Christoph Lameter
2006-02-26  5:57     ` Christoph Lameter
2006-02-26 16:07       ` Hugh Dickins
2006-02-27 15:55         ` Christoph Lameter
2006-02-27 16:32           ` Hugh Dickins
2006-02-27 16:43             ` Christoph Lameter
2006-02-27 17:23               ` Hugh Dickins
2006-02-27 18:11                 ` Christoph Lameter
2006-02-27 18:27                   ` Hugh Dickins
2006-02-27 18:31                     ` Christoph Lameter
2006-02-27 18:43                       ` Hugh Dickins

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.0602241658030.24668@schroedinger.engr.sgi.com \
    --to=clameter@engr.sgi.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