aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/memory.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 601159a46ab6..160f5b503ead 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1577,7 +1577,14 @@ gotten:
1577 entry = mk_pte(new_page, vma->vm_page_prot); 1577 entry = mk_pte(new_page, vma->vm_page_prot);
1578 entry = maybe_mkwrite(pte_mkdirty(entry), vma); 1578 entry = maybe_mkwrite(pte_mkdirty(entry), vma);
1579 lazy_mmu_prot_update(entry); 1579 lazy_mmu_prot_update(entry);
1580 ptep_establish(vma, address, page_table, entry); 1580 /*
1581 * Clear the pte entry and flush it first, before updating the
1582 * pte with the new entry. This will avoid a race condition
1583 * seen in the presence of one thread doing SMC and another
1584 * thread doing COW.
1585 */
1586 ptep_clear_flush(vma, address, page_table);
1587 set_pte_at(mm, address, page_table, entry);
1581 update_mmu_cache(vma, address, entry); 1588 update_mmu_cache(vma, address, entry);
1582 lru_cache_add_active(new_page); 1589 lru_cache_add_active(new_page);
1583 page_add_new_anon_rmap(new_page, vma, address); 1590 page_add_new_anon_rmap(new_page, vma, address);