Re: [PATCH v10 4/4] cgroups: implement the PIDs subsystem

Aleksa Sarai
2015-05-13T17:04:52Z

Hi Tejun

>> >> + /* We use INT_MAX as the maximum value of pid_t. */
>> >> + if (limit < 0 || limit > INT_MAX)
>> >
>> > This is kinda weird if we're using PIDS_MAX for max as it may end up
>> > showing "max" after some larger number is written to the file.
>>
>> The reason for this is because I believe you said "PIDS_MAX isn't
>> meant to be exposed to userspace" (one of the previous patchsets used
>> PIDS_MAX as the maximum valid value).
>
> Yeah, but wouldn't it be weird to allow the userland to input PIDS_MAX
> (whatever value that may be) and reads back max? It can be whatever
> maximum input value + 1, no?

Would you be okay with this?

if (limit < 0 || limit >= PIDS_MAX)

I'd prefer if we used PIDS_MAX as the maximum input value as well as
being the internal representation of the maximum, rather than
switching to something like INT_MAX.

--
Aleksa Sarai (cyphar)