link->cset = cset;
link->cgrp = cgrp;
- list_move(&link->cset_link, &cgrp->cset_links);
-
/*
- * Always add links to the tail of the list so that the list
- * is sorted by order of hierarchy creation
+ * Always add links to the tail of the lists so that the lists are
+ * in choronological order.
*/
+ list_move_tail(&link->cset_link, &cgrp->cset_links);
list_add_tail(&link->cgrp_link, &cset->cgrp_links);
if (cgroup_parent(cgrp))
if (!css_set_populated(cset))
css_set_update_populated(cset, true);
- list_add(&p->cg_list, &cset->tasks);
+ list_add_tail(&p->cg_list, &cset->tasks);
get_css_set(cset);
}
spin_unlock_irq(&p->sighand->siglock);
cset = task_css_set(current);
if (list_empty(&child->cg_list)) {
rcu_assign_pointer(child->cgroups, cset);
- list_add(&child->cg_list, &cset->tasks);
+ list_add_tail(&child->cg_list, &cset->tasks);
get_css_set(cset);
}
up_write(&css_set_rwsem);