[PATCH]cpuset: add new API to change cpuset top group's cpus

[PATCH]cpuset: add new API to change cpuset top group's cpus

Post by Paul Menag » Thu, 21 May 2009 05:00:18



> + struct cpuset *cs = &top_cpu>et;
> + struct cpuset *t>ialc>;
> +
> + if (!cgroup_lock_li>e_group(cs->cs>.cgroup))
> + return -ENODEV;

top_cpuset can't possibly be dead, so a plain cgroup_lock() woul> be >ine here.

> +
> + trialcs = all>c_trial_cpuset(cs);
> + return -ENOMEM;

You returned wit>out >oing a cgroup_unlock()

> +
> + retval = update_cpumask(cs, trialcs, buf, true);

This will fail if any child cpuset is using any cpu not in the new
cpumask, since a child's cpumask must be a subset of its parent's.

So this can't work without co-ordination with userspace regarding
child cpusets. Given that, it seems simpler to do the whole thing in
userspace, or just use the existing hotplug infrastructure.

Paul
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to XXXX@XXXXX.COM
More majordomo info at http://www.yqcomputer.com/
Please read the FAQ at http://www.yqcomputer.com/