diff options
Diffstat (limited to 'mm/mempolicy.c')
-rw-r--r-- | mm/mempolicy.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 4cc19f6ab6c6..c4403cdf3433 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c | |||
@@ -525,8 +525,9 @@ static void queue_pages_hugetlb_pmd_range(struct vm_area_struct *vma, | |||
525 | #ifdef CONFIG_HUGETLB_PAGE | 525 | #ifdef CONFIG_HUGETLB_PAGE |
526 | int nid; | 526 | int nid; |
527 | struct page *page; | 527 | struct page *page; |
528 | spinlock_t *ptl; | ||
528 | 529 | ||
529 | spin_lock(&vma->vm_mm->page_table_lock); | 530 | ptl = huge_pte_lock(hstate_vma(vma), vma->vm_mm, (pte_t *)pmd); |
530 | page = pte_page(huge_ptep_get((pte_t *)pmd)); | 531 | page = pte_page(huge_ptep_get((pte_t *)pmd)); |
531 | nid = page_to_nid(page); | 532 | nid = page_to_nid(page); |
532 | if (node_isset(nid, *nodes) == !!(flags & MPOL_MF_INVERT)) | 533 | if (node_isset(nid, *nodes) == !!(flags & MPOL_MF_INVERT)) |
@@ -536,7 +537,7 @@ static void queue_pages_hugetlb_pmd_range(struct vm_area_struct *vma, | |||
536 | (flags & MPOL_MF_MOVE && page_mapcount(page) == 1)) | 537 | (flags & MPOL_MF_MOVE && page_mapcount(page) == 1)) |
537 | isolate_huge_page(page, private); | 538 | isolate_huge_page(page, private); |
538 | unlock: | 539 | unlock: |
539 | spin_unlock(&vma->vm_mm->page_table_lock); | 540 | spin_unlock(ptl); |
540 | #else | 541 | #else |
541 | BUG(); | 542 | BUG(); |
542 | #endif | 543 | #endif |