aboutsummaryrefslogtreecommitdiffstats
path: root/mm/ksm.c
diff options
context:
space:
mode:
authorHugh Dickins <hugh.dickins@tiscali.co.uk>2009-12-14 20:59:22 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-15 11:53:19 -0500
commit73848b4684e84a84cfd1555af78d41158f31e16b (patch)
treeb71ba30e2b20cbc45740a38e9b5aa51b8c2ea60e /mm/ksm.c
parent08beca44dfb0ab008e365163df70dbd302ae1508 (diff)
ksm: fix mlockfreed to munlocked
When KSM merges an mlocked page, it has been forgetting to munlock it: that's been left to free_page_mlock(), which reports it in /proc/vmstat as unevictable_pgs_mlockfreed instead of unevictable_pgs_munlocked (and whinges "Page flag mlocked set for process" in mmotm, whereas mainline is silently forgiving). Call munlock_vma_page() to fix that. Signed-off-by: Hugh Dickins <hugh.dickins@tiscali.co.uk> Cc: Izik Eidus <ieidus@redhat.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Chris Wright <chrisw@redhat.com> Acked-by: Rik van Riel <riel@redhat.com> Acked-by: Mel Gorman <mel@csn.ul.ie> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/ksm.c')
-rw-r--r--mm/ksm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/mm/ksm.c b/mm/ksm.c
index 748785683399..af5f571185d5 100644
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -34,6 +34,7 @@
34#include <linux/ksm.h> 34#include <linux/ksm.h>
35 35
36#include <asm/tlbflush.h> 36#include <asm/tlbflush.h>
37#include "internal.h"
37 38
38/* 39/*
39 * A few notes about the KSM scanning process, 40 * A few notes about the KSM scanning process,
@@ -762,6 +763,9 @@ static int try_to_merge_one_page(struct vm_area_struct *vma,
762 pages_identical(page, kpage)) 763 pages_identical(page, kpage))
763 err = replace_page(vma, page, kpage, orig_pte); 764 err = replace_page(vma, page, kpage, orig_pte);
764 765
766 if ((vma->vm_flags & VM_LOCKED) && !err)
767 munlock_vma_page(page);
768
765 unlock_page(page); 769 unlock_page(page);
766out: 770out:
767 return err; 771 return err;