diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-10-03 10:34:36 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-03 10:34:36 +0200 |
commit | b5259d944279d0b7e78a83849a352d8ba0447c4c (patch) | |
tree | 42f0e7dc404bc776f9a736c17f52c121da166fc1 /kernel/exit.c | |
parent | 1c50b728c3e734150b8a4a8310ce3e01bc5c70be (diff) | |
parent | 94aca1dac6f6d21f4b07e4864baf7768cabcc6e7 (diff) | |
download | op-kernel-dev-b5259d944279d0b7e78a83849a352d8ba0447c4c.zip op-kernel-dev-b5259d944279d0b7e78a83849a352d8ba0447c4c.tar.gz |
Merge commit 'v2.6.27-rc8' into core/rcu
Diffstat (limited to 'kernel/exit.c')
-rw-r--r-- | kernel/exit.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 1639564..85a83c8 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -583,8 +583,6 @@ mm_need_new_owner(struct mm_struct *mm, struct task_struct *p) * If there are other users of the mm and the owner (us) is exiting * we need to find a new owner to take on the responsibility. */ - if (!mm) - return 0; if (atomic_read(&mm->mm_users) <= 1) return 0; if (mm->owner != p) @@ -627,6 +625,16 @@ retry: } while_each_thread(g, c); read_unlock(&tasklist_lock); + /* + * We found no owner yet mm_users > 1: this implies that we are + * most likely racing with swapoff (try_to_unuse()) or /proc or + * ptrace or page migration (get_task_mm()). Mark owner as NULL, + * so that subsystems can understand the callback and take action. + */ + down_write(&mm->mmap_sem); + cgroup_mm_owner_callbacks(mm->owner, NULL); + mm->owner = NULL; + up_write(&mm->mmap_sem); return; assign_new_owner: |