Index: linux-2.6.15-rc2-mm1/mm/mempolicy.c =================================================================== --- linux-2.6.15-rc2-mm1.orig/mm/mempolicy.c 2005-11-28 16:58:17.000000000 -0800 +++ linux-2.6.15-rc2-mm1/mm/mempolicy.c 2005-11-28 17:24:52.000000000 -0800 @@ -1594,7 +1594,12 @@ static void rebind_policy(struct task_st case MPOL_INTERLEAVE: nodes_remap(tmp, pol->v.nodes, *old, *new); pol->v.nodes = tmp; - task->il_next = node_remap(task->il_next, *old, *new); + /* + * il_next is only updated if this is a task based policy. + * For vma based policies task == NULL + */ + if (task) + task->il_next = node_remap(task->il_next, *old, *new); break; case MPOL_PREFERRED: pol->v.preferred_node = node_remap(pol->v.preferred_node, @@ -1634,15 +1639,15 @@ static void rebind_policy(struct task_st /* * Rebind vma policies in an mm_struct */ -void update_vma_policies(struct task_struct *task, struct mm_struct *mm, - const nodemask_t *old, const nodemask_t *new) +void update_vma_policies(struct mm_struct *mm, const nodemask_t *old, + const nodemask_t *new) { struct vm_area_struct *vma; down_write(&mm->mmap_sem); for (vma = mm->mmap; vma; vma = vma->vm_next) - rebind_policy(task, vma->vm_policy, old, new); + rebind_policy(NULL, vma->vm_policy, old, new); up_write(&mm->mmap_sem); } Index: linux-2.6.15-rc2-mm1/kernel/cpuset.c =================================================================== --- linux-2.6.15-rc2-mm1.orig/kernel/cpuset.c 2005-11-28 16:59:28.000000000 -0800 +++ linux-2.6.15-rc2-mm1/kernel/cpuset.c 2005-11-28 17:23:18.000000000 -0800 @@ -685,7 +685,7 @@ static void refresh_mems(void) do_migrate_pages(current->mm, &oldmem, ¤t->mems_allowed, MPOL_MF_MOVE_ALL); - update_vma_policies(current, current->mm, + update_vma_policies(current->mm, &oldmem, ¤t->mems_allowed); } } @@ -1101,8 +1101,7 @@ static int attach_task(struct cpuset *cs up(&callback_sem); if (is_memory_migrate(cs)) { do_migrate_pages(tsk->mm, &from, &to, MPOL_MF_MOVE_ALL); - /* Ummm.. Are we allowed here to modify tsk->il_next ??? */ - update_vma_policies(tsk, tsk->mm, &from, &to); + update_vma_policies(tsk->mm, &from, &to); } put_task_struct(tsk); if (atomic_dec_and_test(&oldcs->count)) Index: linux-2.6.15-rc2-mm1/include/linux/mempolicy.h =================================================================== --- linux-2.6.15-rc2-mm1.orig/include/linux/mempolicy.h 2005-11-28 16:59:48.000000000 -0800 +++ linux-2.6.15-rc2-mm1/include/linux/mempolicy.h 2005-11-28 17:22:06.000000000 -0800 @@ -147,7 +147,7 @@ struct mempolicy *mpol_shared_policy_loo extern void numa_default_policy(void); extern void numa_policy_init(void); extern void numa_policy_rebind(const nodemask_t *old, const nodemask_t *new); -extern void update_vma_policies(struct task_struct *task, struct mm_struct *mm, +extern void update_vma_policies(struct mm_struct *mm, const nodemask_t *old, const nodemask_t *new); extern struct mempolicy default_policy; extern struct zonelist *huge_zonelist(struct vm_area_struct *vma,