aboutsummaryrefslogtreecommitdiffstats
path: root/mm/huge_memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/huge_memory.c')
-rw-r--r--mm/huge_memory.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index e2f7f5aaaafb..45eaae030628 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -713,6 +713,11 @@ static int __do_huge_pmd_anonymous_page(struct mm_struct *mm,
713 return VM_FAULT_OOM; 713 return VM_FAULT_OOM;
714 714
715 clear_huge_page(page, haddr, HPAGE_PMD_NR); 715 clear_huge_page(page, haddr, HPAGE_PMD_NR);
716 /*
717 * The memory barrier inside __SetPageUptodate makes sure that
718 * clear_huge_page writes become visible before the set_pmd_at()
719 * write.
720 */
716 __SetPageUptodate(page); 721 __SetPageUptodate(page);
717 722
718 spin_lock(&mm->page_table_lock); 723 spin_lock(&mm->page_table_lock);
@@ -724,12 +729,6 @@ static int __do_huge_pmd_anonymous_page(struct mm_struct *mm,
724 } else { 729 } else {
725 pmd_t entry; 730 pmd_t entry;
726 entry = mk_huge_pmd(page, vma); 731 entry = mk_huge_pmd(page, vma);
727 /*
728 * The spinlocking to take the lru_lock inside
729 * page_add_new_anon_rmap() acts as a full memory
730 * barrier to be sure clear_huge_page writes become
731 * visible after the set_pmd_at() write.
732 */
733 page_add_new_anon_rmap(page, vma, haddr); 732 page_add_new_anon_rmap(page, vma, haddr);
734 set_pmd_at(mm, haddr, pmd, entry); 733 set_pmd_at(mm, haddr, pmd, entry);
735 pgtable_trans_huge_deposit(mm, pgtable); 734 pgtable_trans_huge_deposit(mm, pgtable);