powerpc/mm: Add memory barrier in __hugepte_alloc()
[cascardo/linux.git] / arch / powerpc / mm / hugetlbpage.c
index 5aac1a3..6be21e0 100644 (file)
@@ -81,6 +81,13 @@ static int __hugepte_alloc(struct mm_struct *mm, hugepd_t *hpdp,
        if (! new)
                return -ENOMEM;
 
+       /*
+        * Make sure other cpus find the hugepd set only after a
+        * properly initialized page table is visible to them.
+        * For more details look for comment in __pte_alloc().
+        */
+       smp_wmb();
+
        spin_lock(&mm->page_table_lock);
 #ifdef CONFIG_PPC_FSL_BOOK3E
        /*