[Devel] Re: [RFC][PATCH 1/3] CGroups: Add a per-subsystem hierarchy_mutex
Li Zefan
lizf at cn.fujitsu.com
Wed Dec 10 19:05:14 PST 2008
> +static void cgroup_lock_hierarchy(struct cgroupfs_root *root)
> +{
> + /* We need to take each hierarchy_mutex in a consistent order */
This comment is not so clear. Do you mean for_each_subsys() can't be
used here?
But this function is used in cgroup.c internally, and always called
with cgroup_lock held, so it's OK to use for_each_subsys().
> + int i;
> +
> + for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) {
> + struct cgroup_subsys *ss = subsys[i];
> + if (ss->root == root)
> + mutex_lock_nested(&ss->hierarchy_mutex, i);
> + }
> +}
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
More information about the Devel
mailing list