aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/cgroup.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 68d87103b493..105f273b6f86 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -2905,9 +2905,14 @@ static void cgroup_enable_task_cg_lists(void)
2905 * We should check if the process is exiting, otherwise 2905 * We should check if the process is exiting, otherwise
2906 * it will race with cgroup_exit() in that the list 2906 * it will race with cgroup_exit() in that the list
2907 * entry won't be deleted though the process has exited. 2907 * entry won't be deleted though the process has exited.
2908 * Do it while holding siglock so that we don't end up
2909 * racing against cgroup_exit().
2908 */ 2910 */
2911 spin_lock_irq(&p->sighand->siglock);
2909 if (!(p->flags & PF_EXITING) && list_empty(&p->cg_list)) 2912 if (!(p->flags & PF_EXITING) && list_empty(&p->cg_list))
2910 list_add(&p->cg_list, &task_css_set(p)->tasks); 2913 list_add(&p->cg_list, &task_css_set(p)->tasks);
2914 spin_unlock_irq(&p->sighand->siglock);
2915
2911 task_unlock(p); 2916 task_unlock(p);
2912 } while_each_thread(g, p); 2917 } while_each_thread(g, p);
2913 read_unlock(&tasklist_lock); 2918 read_unlock(&tasklist_lock);