fix rmap walk during fork
Subsystems (4)
PATCH 1/1 fix rmap walk during fork
From: Andrea Arcangeli <[email protected]>
The below bug in fork lead to the rmap walk finding the parent huge-pmd twice instead of just one, because the anon_vma_chain objects of the child vma still point to the vma->vm_mm of the parent. The below patch fixes it by making the rmap walk accurate during fork. It's not a big deal normally but it worth being accurate considering the cost is the same.
---
kernel/fork.c +1 -1
@@ -360,10 +360,10 @@ static int dup_mmap(struct mm_struct *mmif (IS_ERR (pol)) goto fail_nomem_policy;vma_set_policy (tmp, pol); + tmp->vm_mm = mm;if (anon_vma_fork (tmp, mpnt)) goto fail_nomem_anon_vma_fork; tmp->vm_flags &= ~VM_LOCKED ; - tmp->vm_mm = mm; tmp->vm_next = tmp->vm_prev =NULL ; file = tmp->vm_file;if (file) {
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 9 lines · Andrea Arcangeli
From: Andrea Arcangeli <[email protected]>
The below bug in fork lead to the rmap walk finding the parent huge-pmd twice instead of just one, because the
anon_vma_chainobjects of the child vma still point to thevma->vm_mmof the parent. The below patch fixes it by making the rmap walk accurate during fork. It's not a big deal normally but it worth being accurate considering the cost is the same.Signed-off-by Andrea Arcangeli <[email protected]>
Quoted 7 lines
---
kernel/fork.c +0
-0@@ -360,10 +360,10 @@ static int dup_mmap(struct mm_struct *mmif (IS_ERR (pol))
kernel/fork.c static int dup_mmap(struct mm_struct *mm · line 369
Quoted 10 lines
kernel/fork.c +1
-1goto fail_nomem_policy;vma_set_policy (tmp, pol); + tmp->vm_mm = mm;if (anon_vma_fork (tmp, mpnt)) goto fail_nomem_anon_vma_fork; tmp->vm_flags &= ~VM_LOCKED ; - tmp->vm_mm = mm; tmp->vm_next = tmp->vm_prev =NULL ; file = tmp->vm_file;if (file) {
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 9 lines · Andrea Arcangeli
From: Andrea Arcangeli <[email protected]>
The below bug in fork lead to the rmap walk finding the parent huge-pmd twice instead of just one, because the
anon_vma_chainobjects of the child vma still point to thevma->vm_mmof the parent. The below patch fixes it by making the rmap walk accurate during fork. It's not a big deal normally but it worth being accurate considering the cost is the same.Signed-off-by Andrea Arcangeli <[email protected]>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 9 lines · Andrea Arcangeli
From: Andrea Arcangeli<[email protected]>
The below bug in fork lead to the rmap walk finding the parent huge-pmd twice instead of just one, because the
anon_vma_chainobjects of the child vma still point to thevma->vm_mmof the parent. The below patch fixes it by making the rmap walk accurate during fork. It's not a big deal normally but it worth being accurate considering the cost is the same.Signed-off-by Andrea Arcangeli<[email protected]>
Signature · 7 lines
All rights reversed -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>