/* The tasklist_lock is not held here, as do_each_thread() and while_each_thread() are protected by RCU.  */
static void cgroup_enable_task_cg_lists(void)
/* The tasklist_lock is not held here, as do_each_thread() and while_each_thread() are protected by RCU.  */
static void cgroup_enable_task_cg_lists(void)
{
	struct task_struct *p, *g;
	write_lock(&css_set_lock);
	use_task_css_set_links = 1;
	do_each_thread(g, p) {
		task_lock(p);
		if (!(p->flags & PF_EXITING) && list_empty(&p->cg_list))
			list_add(&p->cg_list, &p->cgroups->tasks);
		task_unlock(p);
	} while_each_thread(g, p);
	write_unlock(&css_set_lock);
}