mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
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 <[email protected]> Cc: Izik Eidus <[email protected]> Cc: Andrea Arcangeli <[email protected]> Cc: Chris Wright <[email protected]> Acked-by: Rik van Riel <[email protected]> Acked-by: Mel Gorman <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
08beca44df
commit
73848b4684
3 changed files with 8 additions and 3 deletions
4
mm/ksm.c
4
mm/ksm.c
|
|
@ -34,6 +34,7 @@
|
|||
#include <linux/ksm.h>
|
||||
|
||||
#include <asm/tlbflush.h>
|
||||
#include "internal.h"
|
||||
|
||||
/*
|
||||
* A few notes about the KSM scanning process,
|
||||
|
|
@ -762,6 +763,9 @@ static int try_to_merge_one_page(struct vm_area_struct *vma,
|
|||
pages_identical(page, kpage))
|
||||
err = replace_page(vma, page, kpage, orig_pte);
|
||||
|
||||
if ((vma->vm_flags & VM_LOCKED) && !err)
|
||||
munlock_vma_page(page);
|
||||
|
||||
unlock_page(page);
|
||||
out:
|
||||
return err;
|
||||
|
|
|
|||
Loading…
Reference in a new issue