[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOviyah9yyXJG0eUeizpb5ZnzNUAKfxXGkXJw-5sNw7sQOAEuA@mail.gmail.com>
Date: Thu, 14 May 2015 03:04:52 +1000
From: Aleksa Sarai <cyphar@...har.com>
To: Tejun Heo <tj@...nel.org>
Cc: lizefan@...wei.com, mingo@...hat.com,
Peter Zijlstra <peterz@...radead.org>, richard@....at,
Frédéric Weisbecker <fweisbec@...il.com>,
linux-kernel@...r.kernel.org, cgroups@...r.kernel.org
Subject: Re: [PATCH v10 4/4] cgroups: implement the PIDs subsystem
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)
www.cyphar.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists