Skip to contentSkip to conversation

Default values for cpuset.mems, cpus for children created

DISCUSSION Dhaval Giani 2 participants 2 messages Aug 15, 2008 – Sep 4, 2008

lore
Share & tools
lore
#0 lore raw

Hi,

While playing around with libcgroup, one of the isses hit was that attaching a task failed. Looking deeper into it, cpusets had been mounted along with other subsystems. And since we did not care about cpusets, we did not set cpus and mems there.

Now an application programmer does not really care where and how subsystems are mounted (or at least that is what libcgroup aims to achieve :-) ). And such a scenario when the cpuset has not been handled is going to lead to failures which a user is not expecting.

To work around this, I am making a change which will just set the values which the parent group has for unfilled values, but I can already see cpuset breaking that assumption as well. (for example exclusive cpusets).

I was wondering, why can we not have some sane default values set for cpus and mems when a group is created. (That will also avoid a lot of heartbreak for me as well :-) ) (Or if you have some sane solution that has not hit me yet, i am all ears)

Thanks,

Signature · 2 lines
regards,
Dhaval
#1 lore raw
Quoted 9 lines · Dhaval Giani

Now an application programmer does not really care where and how subsystems are mounted (or at least that is what libcgroup aims to achieve :-) ). And such a scenario when the cpuset has not been handled is going to lead to failures which a user is not expecting.

To work around this, I am making a change which will just set the values which the parent group has for unfilled values, but I can already see cpuset breaking that assumption as well. (for example exclusive cpusets).

Yes, this is an awkwardness with the cpusets model of recursively sharing a set of identifiable resources. Quite apart from the backwards compatibility issue, if you make new cpusets inherit their parent's resources you break the exclusive setting, and if you don't you require special setup before the cgroup can be used.

There's already a precedent in the cpuset_clone() function, which does inherit the parent's resources, but I don't think the clone behaviour is widely used, and even that doesn't handle the case of exclusive siblings.

I'm inclined to say that this is a userspace bug - if you don't want cpusets attached to your cgroup hierarchy, don't include them in the set of mounted subsystems.

Paul