From ed515b6898c36775ddd99ff9ffeda4e83917acda Mon Sep 17 00:00:00 2001 From: "Aneesh Kumar K.V" Date: Fri, 1 Jun 2018 13:54:24 +0530 Subject: powerpc/mm/hugetlb: Update hugetlb related locks With split pmd page table lock enabled, we don't use mm->page_table_lock when updating pmd entries. This patch update hugetlb path to use the right lock when inserting huge page directory entries into page table. ex: if we are using hugepd and inserting hugepd entry at the pmd level, we use pmd_lockptr, which based on config can be split pmd lock. For update huge page directory entries itself we use mm->page_table_lock. We do have a helper huge_pte_lockptr() for that. Fixes: 675d99529 ("powerpc/book3s64: Enable split pmd ptlock") Signed-off-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman --- arch/powerpc/mm/pgtable.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'arch/powerpc/mm/pgtable.c') diff --git a/arch/powerpc/mm/pgtable.c b/arch/powerpc/mm/pgtable.c index 5281c2c064af..d71c7777669c 100644 --- a/arch/powerpc/mm/pgtable.c +++ b/arch/powerpc/mm/pgtable.c @@ -249,17 +249,19 @@ extern int huge_ptep_set_access_flags(struct vm_area_struct *vma, if (changed) { #ifdef CONFIG_PPC_BOOK3S_64 - struct hstate *hstate = hstate_file(vma->vm_file); - psize = hstate_get_psize(hstate); + struct hstate *h = hstate_vma(vma); + + psize = hstate_get_psize(h); +#ifdef CONFIG_DEBUG_VM + assert_spin_locked(huge_pte_lockptr(h, vma->vm_mm, ptep)); +#endif + #else /* * Not used on non book3s64 platforms. But 8xx * can possibly use tsize derived from hstate. */ psize = 0; -#endif -#ifdef CONFIG_DEBUG_VM - assert_spin_locked(&vma->vm_mm->page_table_lock); #endif __ptep_set_access_flags(vma, ptep, pte, addr, psize); } -- cgit v1.2.3