mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
mm/ksm.c: mark stable page dirty
The MADV_FREE patchset changes page reclaim to simply free a clean anonymous page with no dirty ptes, instead of swapping it out; but KSM uses clean write-protected ptes to reference the stable ksm page. So be sure to mark that page dirty, so it's never mistakenly discarded. [[email protected]: adjusted comments] Signed-off-by: Minchan Kim <[email protected]> Acked-by: Hugh Dickins <[email protected]> Cc: "James E.J. Bottomley" <[email protected]> Cc: "Kirill A. Shutemov" <[email protected]> Cc: Shaohua Li <[email protected]> Cc: <[email protected]> Cc: Andrea Arcangeli <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Chen Gang <[email protected]> Cc: Chris Zankel <[email protected]> Cc: Daniel Micay <[email protected]> Cc: Darrick J. Wong <[email protected]> Cc: David S. Miller <[email protected]> Cc: Helge Deller <[email protected]> Cc: Ivan Kokshaysky <[email protected]> Cc: Jason Evans <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: KOSAKI Motohiro <[email protected]> Cc: Kirill A. Shutemov <[email protected]> Cc: Matt Turner <[email protected]> Cc: Max Filippov <[email protected]> Cc: Mel Gorman <[email protected]> Cc: Michael Kerrisk <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Mika Penttil <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Richard Henderson <[email protected]> Cc: Rik van Riel <[email protected]> Cc: Roland Dreier <[email protected]> Cc: Russell King <[email protected]> Cc: Shaohua Li <[email protected]> Cc: Will Deacon <[email protected]> Cc: Wu Fengguang <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
10853a0392
commit
337ed7eb5f
1 changed files with 6 additions and 0 deletions
6
mm/ksm.c
6
mm/ksm.c
|
|
@ -1013,6 +1013,12 @@ static int try_to_merge_one_page(struct vm_area_struct *vma,
|
|||
*/
|
||||
set_page_stable_node(page, NULL);
|
||||
mark_page_accessed(page);
|
||||
/*
|
||||
* Page reclaim just frees a clean page with no dirty
|
||||
* ptes: make sure that the ksm page would be swapped.
|
||||
*/
|
||||
if (!PageDirty(page))
|
||||
SetPageDirty(page);
|
||||
err = 0;
|
||||
} else if (pages_identical(page, kpage))
|
||||
err = replace_page(vma, page, kpage, orig_pte);
|
||||
|
|
|
|||
Loading…
Reference in a new issue