diff options
| author | Hugh Dickins <hugh@veritas.com> | 2009-01-06 17:39:22 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-06 18:59:01 -0500 |
| commit | e5991371ee0d1c0ce19e133c6f9075b49c5b4ae8 (patch) | |
| tree | 3e5c9c3293c025f537ff4416660a96d33c694b5f /kernel/exit.c | |
| parent | 39f0dee2d8abe902617622b71f8f6f73985ec71c (diff) | |
mm: remove cgroup_mm_owner_callbacks
cgroup_mm_owner_callbacks() was brought in to support the memrlimit
controller, but sneaked into mainline ahead of it. That controller has
now been shelved, and the mm_owner_changed() args were inadequate for it
anyway (they needed an mm pointer instead of a task pointer).
Remove the dead code, and restore mm_update_next_owner() locking to how it
was before: taking mmap_sem there does nothing for memcontrol.c, now the
only user of mm->owner.
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Cc: Paul Menage <menage@google.com>
Cc: Balbir Singh <balbir@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/exit.c')
| -rw-r--r-- | kernel/exit.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index c9e5a1c14e0..f923724ab3c 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
| @@ -642,35 +642,31 @@ retry: | |||
| 642 | /* | 642 | /* |
| 643 | * We found no owner yet mm_users > 1: this implies that we are | 643 | * We found no owner yet mm_users > 1: this implies that we are |
| 644 | * most likely racing with swapoff (try_to_unuse()) or /proc or | 644 | * most likely racing with swapoff (try_to_unuse()) or /proc or |
| 645 | * ptrace or page migration (get_task_mm()). Mark owner as NULL, | 645 | * ptrace or page migration (get_task_mm()). Mark owner as NULL. |
| 646 | * so that subsystems can understand the callback and take action. | ||
| 647 | */ | 646 | */ |
| 648 | down_write(&mm->mmap_sem); | ||
| 649 | cgroup_mm_owner_callbacks(mm->owner, NULL); | ||
| 650 | mm->owner = NULL; | 647 | mm->owner = NULL; |
| 651 | up_write(&mm->mmap_sem); | ||
| 652 | return; | 648 | return; |
| 653 | 649 | ||
| 654 | assign_new_owner: | 650 | assign_new_owner: |
| 655 | BUG_ON(c == p); | 651 | BUG_ON(c == p); |
| 656 | get_task_struct(c); | 652 | get_task_struct(c); |
| 657 | read_unlock(&tasklist_lock); | ||
| 658 | down_write(&mm->mmap_sem); | ||
| 659 | /* | 653 | /* |
| 660 | * The task_lock protects c->mm from changing. | 654 | * The task_lock protects c->mm from changing. |
| 661 | * We always want mm->owner->mm == mm | 655 | * We always want mm->owner->mm == mm |
| 662 | */ | 656 | */ |
| 663 | task_lock(c); | 657 | task_lock(c); |
| 658 | /* | ||
| 659 | * Delay read_unlock() till we have the task_lock() | ||
| 660 | * to ensure that c does not slip away underneath us | ||
| 661 | */ | ||
| 662 | read_unlock(&tasklist_lock); | ||
| 664 | if (c->mm != mm) { | 663 | if (c->mm != mm) { |
| 665 | task_unlock(c); | 664 | task_unlock(c); |
| 666 | up_write(&mm->mmap_sem); | ||
| 667 | put_task_struct(c); | 665 | put_task_struct(c); |
| 668 | goto retry; | 666 | goto retry; |
| 669 | } | 667 | } |
| 670 | cgroup_mm_owner_callbacks(mm->owner, c); | ||
| 671 | mm->owner = c; | 668 | mm->owner = c; |
| 672 | task_unlock(c); | 669 | task_unlock(c); |
| 673 | up_write(&mm->mmap_sem); | ||
| 674 | put_task_struct(c); | 670 | put_task_struct(c); |
| 675 | } | 671 | } |
| 676 | #endif /* CONFIG_MM_OWNER */ | 672 | #endif /* CONFIG_MM_OWNER */ |
