Re: [PATCH v2] kernel: add pid_max to pid_namespace

From: Steven Rostedt
Date: Tue Nov 12 2024 - 18:41:30 EST


On Tue, 5 Nov 2024 11:10:24 +0800
Yun Zhou <yun.zhou@xxxxxxxxxxxxx> 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>

Acked-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>

-- Steve

> ---
> - Remove sentinels from ctl_table arrays.
> v1 - https://lore.kernel.org/all/20241030052933.1041408-1-yun.zhou@xxxxxxxxxxxxx/
> ---
> include/linux/pid_namespace.h | 1 +
> kernel/pid.c | 12 +++++------
> kernel/pid_namespace.c | 34 ++++++++++++++++++++++++++-----
> kernel/sysctl.c | 9 --------
> kernel/trace/pid_list.c | 2 +-
> kernel/trace/trace.h | 2 --
> kernel/trace/trace_sched_switch.c | 2 +-
> 7 files changed, 38 insertions(+), 24 deletions(-)