]> err.no Git - linux-2.6/commitdiff
[PATCH] Drop page table lock before calling migrate_page_add()
authorChristoph Lameter <clameter@engr.sgi.com>
Sun, 8 Jan 2006 09:01:02 +0000 (01:01 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 9 Jan 2006 04:12:44 +0000 (20:12 -0800)
migrate_page_add cannot be called with a spinlock held (calls
isolate_lru_page which calles schedule_on_each_cpu).  Drop ptl lock in
check_pte_range before calling migrate_page_add().

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
mm/mempolicy.c

index 44b9d69900bc2909da98e502a3aca5bed4710a93..4c0510e9e7f660223d069b9578f4b07e92a90f39 100644 (file)
@@ -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);