summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/mempolicy.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 44b9d69900b..4c0510e9e7f 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -259,8 +259,11 @@ static int check_pte_range(struct vm_area_struct *vma, pmd_t *pmd,
if (flags & MPOL_MF_STATS)
gather_stats(page, private);
- else if (flags & (MPOL_MF_MOVE | MPOL_MF_MOVE_ALL))
+ else if (flags & (MPOL_MF_MOVE | MPOL_MF_MOVE_ALL)) {
+ spin_unlock(ptl);
migrate_page_add(vma, page, private, flags);
+ spin_lock(ptl);
+ }
else
break;
} while (pte++, addr += PAGE_SIZE, addr != end);