Re: [PATCH v4 2/2] cgroups: add a pids subsystem

Austin S Hemmelgarn
2015-03-10T11:32:33Z

On 2015-03-10 04:10, Aleksa Sarai wrote:
> Hi Austin,
>
>>> Does pids limit make sense in the root cgroup?
>>>
>> I would say it kind of does, although I would just expect it to track
>> /proc/sys/kernel/pid_max (either as a read-only value, or as an alternative
>> way to set it).
>
> Personally, that seems unintuitive. /proc/sys/kernel/pid_max and the pids
> cgroup controller are orthogonal features, why should they be able to affect
> each other (or even be aware of each other)?
I wouldn't consider them entirely orthogonal, the sysctl value is the
limiting factor for the maximal value that can be set in a given pids
cgroup. Setting an unlimited value in the cgroup is functionally
identical to setting it to be equal to /proc/sys/kernel/pid_max, and the
root cgroup is functionally equivalent to /proc/sys/kernel/pid_max,
because all tasks that aren't in another cgroup get put in the root.

My only thought is that having the file that would set the limit there
might make things much simpler for software that expects the entire
cgroup structure to be hierarchical.