aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2013-05-24 18:55:21 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-24 19:22:51 -0400
commit7c3425123ddfdc5f48e7913ff59d908789712b18 (patch)
treedb90e8a106aab6f788e12a3b1e08e11a37a9ef20
parent7450231fb35492951e78a91b833fd935171f4e66 (diff)
mm/THP: use pmd_populate() to update the pmd with pgtable_t pointer
We should not use set_pmd_at to update pmd_t with pgtable_t pointer. set_pmd_at is used to set pmd with huge pte entries and architectures like ppc64, clear few flags from the pte when saving a new entry. Without this change we observe bad pte errors like below on ppc64 with THP enabled. BUG: Bad page map in process ld mm=0xc000001ee39f4780 pte:7fc3f37848000001 pmd:c000001ec0000000 Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Cc: Hugh Dickins <hughd@google.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Reviewed-by: Andrea Arcangeli <aarcange@redhat.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--mm/huge_memory.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 03a89a2f464b..362c329b83fe 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -2325,7 +2325,12 @@ static void collapse_huge_page(struct mm_struct *mm,
2325 pte_unmap(pte); 2325 pte_unmap(pte);
2326 spin_lock(&mm->page_table_lock); 2326 spin_lock(&mm->page_table_lock);
2327 BUG_ON(!pmd_none(*pmd)); 2327 BUG_ON(!pmd_none(*pmd));
2328 set_pmd_at(mm, address, pmd, _pmd); 2328 /*
2329 * We can only use set_pmd_at when establishing
2330 * hugepmds and never for establishing regular pmds that
2331 * points to regular pagetables. Use pmd_populate for that
2332 */
2333 pmd_populate(mm, pmd, pmd_pgtable(_pmd));
2329 spin_unlock(&mm->page_table_lock); 2334 spin_unlock(&mm->page_table_lock);
2330 anon_vma_unlock_write(vma->anon_vma); 2335 anon_vma_unlock_write(vma->anon_vma);
2331 goto out; 2336 goto out;