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/cgroup.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/cgroup.c')
-rw-r--r-- | kernel/cgroup.c | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 87bb0258fd27..f221446aa02d 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -116,7 +116,6 @@ static int root_count; | |||
116 | * be called. | 116 | * be called. |
117 | */ | 117 | */ |
118 | static int need_forkexit_callback __read_mostly; | 118 | static int need_forkexit_callback __read_mostly; |
119 | static int need_mm_owner_callback __read_mostly; | ||
120 | 119 | ||
121 | /* convenient tests for these bits */ | 120 | /* convenient tests for these bits */ |
122 | inline int cgroup_is_removed(const struct cgroup *cgrp) | 121 | inline int cgroup_is_removed(const struct cgroup *cgrp) |
@@ -2539,7 +2538,6 @@ static void __init cgroup_init_subsys(struct cgroup_subsys *ss) | |||
2539 | init_css_set.subsys[ss->subsys_id] = dummytop->subsys[ss->subsys_id]; | 2538 | init_css_set.subsys[ss->subsys_id] = dummytop->subsys[ss->subsys_id]; |
2540 | 2539 | ||
2541 | need_forkexit_callback |= ss->fork || ss->exit; | 2540 | need_forkexit_callback |= ss->fork || ss->exit; |
2542 | need_mm_owner_callback |= !!ss->mm_owner_changed; | ||
2543 | 2541 | ||
2544 | /* At system boot, before all subsystems have been | 2542 | /* At system boot, before all subsystems have been |
2545 | * registered, no tasks have been forked, so we don't | 2543 | * registered, no tasks have been forked, so we don't |
@@ -2789,37 +2787,6 @@ void cgroup_fork_callbacks(struct task_struct *child) | |||
2789 | } | 2787 | } |
2790 | } | 2788 | } |
2791 | 2789 | ||
2792 | #ifdef CONFIG_MM_OWNER | ||
2793 | /** | ||
2794 | * cgroup_mm_owner_callbacks - run callbacks when the mm->owner changes | ||
2795 | * @p: the new owner | ||
2796 | * | ||
2797 | * Called on every change to mm->owner. mm_init_owner() does not | ||
2798 | * invoke this routine, since it assigns the mm->owner the first time | ||
2799 | * and does not change it. | ||
2800 | * | ||
2801 | * The callbacks are invoked with mmap_sem held in read mode. | ||
2802 | */ | ||
2803 | void cgroup_mm_owner_callbacks(struct task_struct *old, struct task_struct *new) | ||
2804 | { | ||
2805 | struct cgroup *oldcgrp, *newcgrp = NULL; | ||
2806 | |||
2807 | if (need_mm_owner_callback) { | ||
2808 | int i; | ||
2809 | for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) { | ||
2810 | struct cgroup_subsys *ss = subsys[i]; | ||
2811 | oldcgrp = task_cgroup(old, ss->subsys_id); | ||
2812 | if (new) | ||
2813 | newcgrp = task_cgroup(new, ss->subsys_id); | ||
2814 | if (oldcgrp == newcgrp) | ||
2815 | continue; | ||
2816 | if (ss->mm_owner_changed) | ||
2817 | ss->mm_owner_changed(ss, oldcgrp, newcgrp, new); | ||
2818 | } | ||
2819 | } | ||
2820 | } | ||
2821 | #endif /* CONFIG_MM_OWNER */ | ||
2822 | |||
2823 | /** | 2790 | /** |
2824 | * cgroup_post_fork - called on a new task after adding it to the task list | 2791 | * cgroup_post_fork - called on a new task after adding it to the task list |
2825 | * @child: the task in question | 2792 | * @child: the task in question |