Commit [a247c3] Maximize Restore History

rmap: fix walk during fork

The below bug in fork led to the rmap walk finding the parent huge-pmd
twice instead of just once, because the anon_vma_chain objects of the
child vma still point to the vma->vm_mm of the parent.

The 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 <>
Acked-by: Johannes Weiner <>
Acked-by: Rik van Riel <>
Acked-by: Hugh Dickins <>
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>

Andrea Arcangeli Andrea Arcangeli 2010-09-22

Linus Torvalds Linus Torvalds 2010-09-23

changed kernel
changed kernel/fork.c
kernel/fork.c Diff Switch to side-by-side view