diff options
Diffstat (limited to 'mm/rmap.c')
-rw-r--r-- | mm/rmap.c | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -601,7 +601,7 @@ pte_t *__page_check_address(struct page *page, struct mm_struct *mm, | |||
601 | 601 | ||
602 | if (unlikely(PageHuge(page))) { | 602 | if (unlikely(PageHuge(page))) { |
603 | pte = huge_pte_offset(mm, address); | 603 | pte = huge_pte_offset(mm, address); |
604 | ptl = &mm->page_table_lock; | 604 | ptl = huge_pte_lockptr(page_hstate(page), mm, pte); |
605 | goto check; | 605 | goto check; |
606 | } | 606 | } |
607 | 607 | ||
@@ -665,25 +665,23 @@ int page_referenced_one(struct page *page, struct vm_area_struct *vma, | |||
665 | unsigned long *vm_flags) | 665 | unsigned long *vm_flags) |
666 | { | 666 | { |
667 | struct mm_struct *mm = vma->vm_mm; | 667 | struct mm_struct *mm = vma->vm_mm; |
668 | spinlock_t *ptl; | ||
668 | int referenced = 0; | 669 | int referenced = 0; |
669 | 670 | ||
670 | if (unlikely(PageTransHuge(page))) { | 671 | if (unlikely(PageTransHuge(page))) { |
671 | pmd_t *pmd; | 672 | pmd_t *pmd; |
672 | 673 | ||
673 | spin_lock(&mm->page_table_lock); | ||
674 | /* | 674 | /* |
675 | * rmap might return false positives; we must filter | 675 | * rmap might return false positives; we must filter |
676 | * these out using page_check_address_pmd(). | 676 | * these out using page_check_address_pmd(). |
677 | */ | 677 | */ |
678 | pmd = page_check_address_pmd(page, mm, address, | 678 | pmd = page_check_address_pmd(page, mm, address, |
679 | PAGE_CHECK_ADDRESS_PMD_FLAG); | 679 | PAGE_CHECK_ADDRESS_PMD_FLAG, &ptl); |
680 | if (!pmd) { | 680 | if (!pmd) |
681 | spin_unlock(&mm->page_table_lock); | ||
682 | goto out; | 681 | goto out; |
683 | } | ||
684 | 682 | ||
685 | if (vma->vm_flags & VM_LOCKED) { | 683 | if (vma->vm_flags & VM_LOCKED) { |
686 | spin_unlock(&mm->page_table_lock); | 684 | spin_unlock(ptl); |
687 | *mapcount = 0; /* break early from loop */ | 685 | *mapcount = 0; /* break early from loop */ |
688 | *vm_flags |= VM_LOCKED; | 686 | *vm_flags |= VM_LOCKED; |
689 | goto out; | 687 | goto out; |
@@ -692,10 +690,9 @@ int page_referenced_one(struct page *page, struct vm_area_struct *vma, | |||
692 | /* go ahead even if the pmd is pmd_trans_splitting() */ | 690 | /* go ahead even if the pmd is pmd_trans_splitting() */ |
693 | if (pmdp_clear_flush_young_notify(vma, address, pmd)) | 691 | if (pmdp_clear_flush_young_notify(vma, address, pmd)) |
694 | referenced++; | 692 | referenced++; |
695 | spin_unlock(&mm->page_table_lock); | 693 | spin_unlock(ptl); |
696 | } else { | 694 | } else { |
697 | pte_t *pte; | 695 | pte_t *pte; |
698 | spinlock_t *ptl; | ||
699 | 696 | ||
700 | /* | 697 | /* |
701 | * rmap might return false positives; we must filter | 698 | * rmap might return false positives; we must filter |