/* but taking great care only to touch a ksm page, in a VM_MERGEABLE vma, in case the application has unmapped and remapped mm,addr meanwhile. Could a ksm page appear anywhere else? Actually yes, in a VM_PFNMAP mmap of /dev/mem or /dev/kmem, where we would not want to touch it.  */
static int break_ksm(struct vm_area_struct *vma, unsigned long addr)
/* but taking great care only to touch a ksm page, in a VM_MERGEABLE vma, in case the application has unmapped and remapped mm,addr meanwhile. Could a ksm page appear anywhere else? Actually yes, in a VM_PFNMAP mmap of /dev/mem or /dev/kmem, where we would not want to touch it.  */
static int break_ksm(struct vm_area_struct *vma, unsigned long addr)
{
	struct page *page;
	int ret = 0;
	do {
		cond_resched();
		page = follow_page(vma, addr, FOLL_GET);
		if (!page)
			break;
		if (PageKsm(page))
			ret = handle_mm_fault(vma->vm_mm, vma, addr,
							FAULT_FLAG_WRITE);
		else
			ret = VM_FAULT_WRITE;
		put_page(page);
	} while (!(ret & (VM_FAULT_WRITE | VM_FAULT_SIGBUS | VM_FAULT_OOM)));
	return (ret & VM_FAULT_OOM) ? -ENOMEM : 0;
}