diff options
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r-- | kernel/cgroup.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 13932abde159..8c6e1c17e6d3 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -2735,21 +2735,24 @@ void cgroup_fork_callbacks(struct task_struct *child) | |||
2735 | * Called on every change to mm->owner. mm_init_owner() does not | 2735 | * Called on every change to mm->owner. mm_init_owner() does not |
2736 | * invoke this routine, since it assigns the mm->owner the first time | 2736 | * invoke this routine, since it assigns the mm->owner the first time |
2737 | * and does not change it. | 2737 | * and does not change it. |
2738 | * | ||
2739 | * The callbacks are invoked with mmap_sem held in read mode. | ||
2738 | */ | 2740 | */ |
2739 | void cgroup_mm_owner_callbacks(struct task_struct *old, struct task_struct *new) | 2741 | void cgroup_mm_owner_callbacks(struct task_struct *old, struct task_struct *new) |
2740 | { | 2742 | { |
2741 | struct cgroup *oldcgrp, *newcgrp; | 2743 | struct cgroup *oldcgrp, *newcgrp = NULL; |
2742 | 2744 | ||
2743 | if (need_mm_owner_callback) { | 2745 | if (need_mm_owner_callback) { |
2744 | int i; | 2746 | int i; |
2745 | for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) { | 2747 | for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) { |
2746 | struct cgroup_subsys *ss = subsys[i]; | 2748 | struct cgroup_subsys *ss = subsys[i]; |
2747 | oldcgrp = task_cgroup(old, ss->subsys_id); | 2749 | oldcgrp = task_cgroup(old, ss->subsys_id); |
2748 | newcgrp = task_cgroup(new, ss->subsys_id); | 2750 | if (new) |
2751 | newcgrp = task_cgroup(new, ss->subsys_id); | ||
2749 | if (oldcgrp == newcgrp) | 2752 | if (oldcgrp == newcgrp) |
2750 | continue; | 2753 | continue; |
2751 | if (ss->mm_owner_changed) | 2754 | if (ss->mm_owner_changed) |
2752 | ss->mm_owner_changed(ss, oldcgrp, newcgrp); | 2755 | ss->mm_owner_changed(ss, oldcgrp, newcgrp, new); |
2753 | } | 2756 | } |
2754 | } | 2757 | } |
2755 | } | 2758 | } |