]> www.infradead.org Git - users/dwmw2/linux.git/commit
pid: Do not set pid_max in new pid namespaces
authorMichal Koutný <mkoutny@suse.com>
Wed, 5 Mar 2025 14:58:49 +0000 (15:58 +0100)
committerChristian Brauner <brauner@kernel.org>
Thu, 6 Mar 2025 09:18:36 +0000 (10:18 +0100)
commitd385c8bceb14665e935419334aa3d3fac2f10456
tree4b3abd62055a41c32ba1ae010d863368eb50d652
parent50dc696c3a482ea35bd0691f728d47e40b668483
pid: Do not set pid_max in new pid namespaces

It is already difficult for users to troubleshoot which of multiple pid
limits restricts their workload. The per-(hierarchical-)NS pid_max would
contribute to the confusion.
Also, the implementation copies the limit upon creation from
parent, this pattern showed cumbersome with some attributes in legacy
cgroup controllers -- it's subject to race condition between parent's
limit modification and children creation and once copied it must be
changed in the descendant.

Let's do what other places do (ucounts or cgroup limits) -- create new
pid namespaces without any limit at all. The global limit (actually any
ancestor's limit) is still effectively in place, we avoid the
set/unshare race and bumps of global (ancestral) limit have the desired
effect on pid namespace that do not care.

Link: https://lore.kernel.org/r/20240408145819.8787-1-mkoutny@suse.com/
Link: https://lore.kernel.org/r/20250221170249.890014-1-mkoutny@suse.com/
Fixes: 7863dcc72d0f4 ("pid: allow pid_max to be set per pid namespace")
Signed-off-by: Michal Koutný <mkoutny@suse.com>
Link: https://lore.kernel.org/r/20250305145849.55491-1-mkoutny@suse.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
kernel/pid_namespace.c