--- a/mm/ksm.c~mm-ksmc-update-get_user_pages-in-comment +++ a/mm/ksm.c @@ -455,7 +455,7 @@ static inline bool ksm_test_exit(struct /* * We use break_ksm to break COW on a ksm page: it's a stripped down * - * if (get_user_pages(addr, 1, 1, 1, &page, NULL) == 1) + * if (get_user_pages(addr, 1, FOLL_WRITE, &page, NULL) == 1) * put_page(page); * * but taking great care only to touch a ksm page, in a VM_MERGEABLE vma,