mlock: do not munlock pages in __do_fault()
authorMichel Lespinasse <walken@google.com>
Thu, 10 Feb 2011 23:01:33 +0000 (15:01 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 12 Feb 2011 00:12:20 +0000 (16:12 -0800)
commit419d8c96dbfa558f00e623023917d0a5afc46129
tree74882b1ed7340d3d0e448b343c52fd12969ea518
parente15f8c01af924e611bc7be1e45449c4a74e5dfdd
mlock: do not munlock pages in __do_fault()

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>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Hugh Dickins <hughd@google.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/memory.c