diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com> | 2018-06-01 13:54:24 +0530 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2018-06-03 20:40:37 +1000 |
commit | ed515b6898c36775ddd99ff9ffeda4e83917acda (patch) | |
tree | 565dfa28eaa7de9126c40c0e0d052e59ab9445a0 /arch/powerpc/mm/pgtable.c | |
parent | 91d06971881f71d945910de128658038513d1b24 (diff) | |
download | linux-stable-ed515b6898c36775ddd99ff9ffeda4e83917acda.tar.gz linux-stable-ed515b6898c36775ddd99ff9ffeda4e83917acda.tar.bz2 linux-stable-ed515b6898c36775ddd99ff9ffeda4e83917acda.zip |
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 <aneesh.kumar@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/mm/pgtable.c')
-rw-r--r-- | arch/powerpc/mm/pgtable.c | 12 |
1 files changed, 7 insertions, 5 deletions
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,8 +249,13 @@ 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 @@ -258,9 +263,6 @@ extern int huge_ptep_set_access_flags(struct vm_area_struct *vma, */ 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); } return changed; |