linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michel Lespinasse <walken@google.com>
To: Andrea Arcangeli <aarcange@redhat.com>,
	Rik van Riel <riel@redhat.com>, Hugh Dickins <hughd@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>, linux-mm <linux-mm@kvack.org>
Subject: THP, rmap and page_referenced_one()
Date: Sun, 6 Mar 2011 22:50:21 -0800	[thread overview]
Message-ID: <AANLkTikJpr9H2NJHyw_uajL=Ef_p16L3QYgmJSfFynSZ@mail.gmail.com> (raw)

Hi,

I have been wondering about the following:

Before the THP work, the if (vma->vm_flags & VM_LOCKED) test in
page_referenced_one() was placed after the page_check_address() call,
but now it is placed above it. Could this be a problem ?

My understanding is that the page_check_address() check may return
false positives - for example, if an anon page was created before a
process forked, rmap will indicate that the page could be mapped in
both of the processes, even though one of them might have since broken
COW. What would happen if the child process mlocks the corresponding
VMA ? my understanding is that this would break COW, but not cause
rmap to be updated, so the parent's page would still be marked in rmap
as being possibly mapped in the children's VM_LOCKED vma. With the
VM_LOCKED check now placed above the page_check_address() call, this
would cause vmscan to see both the parent's and the child's pages as
being unevictable.

Am I missing something there ? In particular, I am not sure if marking
the children's VMA as mlocked would somehow cause rmap to realize it
can't share pages with the parent anymore (but I don't think that's
the case, and it could cause other issues if it was...)

-- 
Michel "Walken" Lespinasse
A program is never fully debugged until the last user dies.

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

             reply	other threads:[~2011-03-07  6:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-07  6:50 Michel Lespinasse [this message]
2011-03-07  7:33 ` THP, rmap and page_referenced_one() KOSAKI Motohiro
2011-03-07  8:35 ` Minchan Kim
2011-03-07 10:35   ` Michel Lespinasse
2011-03-08 11:32     ` Andrea Arcangeli
2011-03-08 12:21       ` Michel Lespinasse
2011-03-08 12:58         ` Andrea Arcangeli
2011-03-08 22:48           ` Minchan Kim
2011-03-09  9:18           ` Johannes Weiner
2011-03-08 13:57       ` Rik van Riel
2011-03-09  7:11         ` KOSAKI Motohiro

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='AANLkTikJpr9H2NJHyw_uajL=Ef_p16L3QYgmJSfFynSZ@mail.gmail.com' \
    --to=walken@google.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hughd@google.com \
    --cc=linux-mm@kvack.org \
    --cc=riel@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).