Re: [PATCH v2] kernel: add pid_max to pid_namespace
From: Tycho Andersen
Date: Thu Nov 21 2024 - 09:34:16 EST
On Wed, Nov 20, 2024 at 10:06:27AM +0100, Christian Brauner wrote:
> On Tue, Nov 05, 2024 at 11:10:24AM +0800, Yun Zhou wrote:
> > It is necessary to have a different pid_max in different containers.
> > For example, multiple containers are running on a host, one of which
> > is Android, and its 32 bit bionic libc only accepts pid <= 65535. So
> > it requires the global pid_max <= 65535. This will cause configuration
> > conflicts with other containers and also limit the maximum number of
> > tasks for the entire system.
> >
> > Signed-off-by: Yun Zhou <yun.zhou@xxxxxxxxxxxxx>
> > ---
>
> Fwiw, I've done a patch like this years ago and then Alex revived it in
> [1] including selftests! There's downsides to consider:
>
> [1]: https://lore.kernel.org/lkml/20240222160915.315255-1-aleksandr.mikhalitsyn@xxxxxxxxxxxxx
Thanks, looks like this patch has the same oddity.
For me it's enough to just walk up the tree when changing pid_max. It
seems unlikely that applications will create a sub pidns and then lower
the max in their own pid_max. Famous last words and all that.
Tycho