The patch titled Subject: mm: mark stable page dirty in KSM has been removed from the -mm tree. Its filename was mm-mark-stable-page-dirty-in-ksm.patch This patch was dropped because an updated version will be merged ------------------------------------------------------ From: Minchan Kim <minchan@xxxxxxxxxx> Subject: mm: mark stable page dirty in KSM Stable page could be shared by several processes and last process could own the page among them after CoW or zapping for every process except last process happens. Then, page table entry of the page in last process can have no dirty bit and PG_dirty flag in page->flags. In this case, MADV_FREE could discard the page wrongly. For preventing it, we mark stable page dirty. Signed-off-by: Minchan Kim <minchan@xxxxxxxxxx> Cc: Hugh Dickins <hughd@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/ksm.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff -puN mm/ksm.c~mm-mark-stable-page-dirty-in-ksm mm/ksm.c --- a/mm/ksm.c~mm-mark-stable-page-dirty-in-ksm +++ a/mm/ksm.c @@ -1050,6 +1050,18 @@ static int try_to_merge_one_page(struct */ set_page_stable_node(page, NULL); mark_page_accessed(page); + /* + * Stable page could be shared by several processes + * and last process could own the page among them after + * CoW or zapping for every process except last process + * happens. Then, page table entry of the page + * in last process can have no dirty bit. + * In this case, MADV_FREE could discard the page + * wrongly. + * For preventing it, we mark stable page dirty. + */ + if (!PageDirty(page)) + SetPageDirty(page); err = 0; } else if (pages_identical(page, kpage)) err = replace_page(vma, page, kpage, orig_pte); _ Patches currently in -mm which might be from minchan@xxxxxxxxxx are x86-add-pmd_-for-thp.patch sparc-add-pmd_-for-thp.patch powerpc-add-pmd_-for-thp.patch arm-add-pmd_mkclean-for-thp.patch arm64-add-pmd_-for-thp.patch mm-dont-split-thp-page-when-syscall-is-called.patch mm-free-swp_entry-in-madvise_free.patch mm-move-lazy-free-pages-to-inactive-list.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html