Thread (53 messages) 53 messages, 3 authors, 2016-02-24

[PATCHv2 15/28] thp: handle file COW faults

From: Kirill A. Shutemov <hidden>
Date: 2016-02-11 14:23:05
Also in: lkml
Subsystem: memory management, memory management - core, the rest · Maintainers: Andrew Morton, David Hildenbrand, Linus Torvalds

File COW for THP is handled on pte level: just split the pmd.

Signed-off-by: Kirill A. Shutemov <redacted>
---
 mm/memory.c | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/mm/memory.c b/mm/memory.c
index 6c98ed8e3c4a..19eff2164e5b 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -3334,6 +3334,11 @@ static int wp_huge_pmd(struct fault_env *fe, pmd_t orig_pmd)
 	if (fe->vma->vm_ops->pmd_fault)
 		return fe->vma->vm_ops->pmd_fault(fe->vma, fe->address, fe->pmd,
 				fe->flags);
+
+	/* COW handled on pte level: split pmd */
+	VM_BUG_ON_VMA(fe->vma->vm_flags & VM_SHARED, fe->vma);
+	split_huge_pmd(fe->vma, fe->pmd, fe->address);
+
 	return VM_FAULT_FALLBACK;
 }
 
-- 
2.7.0

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help