LKML Archive on
help / color / mirror / Atom feed
From: Michel Lespinasse <>
To:, Lee Schermerhorn <>
Cc: Andrew Morton <>,
	KAMEZAWA Hiroyuki <>,
	Hugh Dickins <>, Rik van Riel <>,
	Andrea Arcangeli <>,
Subject: [PATCH 0/2] page munlock issues when breaking up COW
Date: Mon,  7 Feb 2011 16:47:34 -0800	[thread overview]
Message-ID: <> (raw)

It looks like there is a race in the do_wp_page() code that munlocks the
old page after breaking up COW. The pte still points to that old page,
so I don't see that we are protected against vmscan mlocking back the
page right away. This can be easily worked around by moving that code to
the end of do_wp_page(), after the pte has been pointed to the new page.

Also, the corresponding code in __do_fault() seems entirely unnecessary,
since there was never a pte pointing to the old page in our vma.

Michel Lespinasse (2):
  mlock: fix race when munlocking pages in do_wp_page()
  mlock: do not munlock pages in __do_fault()

 mm/memory.c |   32 ++++++++++++--------------------
 1 files changed, 12 insertions(+), 20 deletions(-)


             reply	other threads:[~2011-02-08  0:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-08  0:47 Michel Lespinasse [this message]
2011-02-08  0:47 ` [PATCH 1/2] mlock: fix race when munlocking pages in do_wp_page() Michel Lespinasse
2011-02-08  1:45   ` KAMEZAWA Hiroyuki
2011-02-08 18:28   ` Hugh Dickins
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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH 0/2] page munlock issues when breaking up COW' \

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