LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Michel Lespinasse <walken@google.com>
To: Nick Piggin <npiggin@kernel.dk>, linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] mlock: do not munlock pages in __do_fault()
Date: Wed,  8 Dec 2010 23:49:39 -0800	[thread overview]
Message-ID: <1291880979-16309-3-git-send-email-walken@google.com> (raw)
In-Reply-To: <1291880979-16309-1-git-send-email-walken@google.com>

If the page is going to be written to, __do_page needs to break COW.
However, the old page (before breaking COW) was never mapped mapped into
the current pte (__do_fault is only called when the pte is not present),
so vmscan can't have marked the old page as PageMlocked due to being
mapped in __do_fault's VMA. Therefore, __do_fault() does not need to worry
about clearing PageMlocked() on the old page.

Signed-off-by: Michel Lespinasse <walken@google.com>
---
 mm/memory.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/mm/memory.c b/mm/memory.c
index 68f2dbe..7befd03 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -3015,12 +3015,6 @@ static int __do_fault(struct mm_struct *mm, struct vm_area_struct *vma,
 				goto out;
 			}
 			charged = 1;
-			/*
-			 * Don't let another task, with possibly unlocked vma,
-			 * keep the mlocked page.
-			 */
-			if (vma->vm_flags & VM_LOCKED)
-				clear_page_mlock(vmf.page);
 			copy_user_highpage(page, vmf.page, address, vma);
 			__SetPageUptodate(page);
 		} else {
-- 
1.7.3.1


  parent reply	other threads:[~2010-12-09  7:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-09  7:49 [PATCH 0/2] RFC: page munlock issues when breaking up COW Michel Lespinasse
2010-12-09  7:49 ` [PATCH 1/2] mlock: fix race when munlocking pages in do_wp_page() Michel Lespinasse
2010-12-09  7:49 ` Michel Lespinasse [this message]
2011-02-08  0:47 [PATCH 0/2] page munlock issues when breaking up COW Michel Lespinasse
2011-02-08  0:47 ` [PATCH 2/2] mlock: do not munlock pages in __do_fault() Michel Lespinasse
2011-02-08  1:47   ` KAMEZAWA Hiroyuki
2011-02-08 18:29   ` 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=1291880979-16309-3-git-send-email-walken@google.com \
    --to=walken@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=npiggin@kernel.dk \
    --subject='Re: [PATCH 2/2] mlock: do not munlock pages in __do_fault()' \
    /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

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).