]> www.infradead.org Git - users/jedix/linux-maple.git/commit
cgroup/pids: Separate semantics of pids.events related to pids.max
authorMichal Koutný <mkoutny@suse.com>
Tue, 21 May 2024 09:21:26 +0000 (11:21 +0200)
committerTejun Heo <tj@kernel.org>
Sun, 26 May 2024 18:45:09 +0000 (08:45 -1000)
commit73e75e6fc352bdca08f7e0893d5b6bb37171bdd2
tree4e276aeb7f2bd38279855e70cb7388ffdf98a92c
parent0ac380020cd469a7cd23f517ff2753d0f6ac48c9
cgroup/pids: Separate semantics of pids.events related to pids.max

Currently, when pids.max limit is breached in the hierarchy, the event
is counted and reported in the cgroup where the forking task resides.

This decouples the limit and the notification caused by the limit making
it hard to detect when the actual limit was effected.

Redefine the pids.events:max as: the number of times the limit of the
cgroup was hit.

(Implementation differentiates also "forkfail" event but this is
currently not exposed as it would better fit into pids.stat. It also
differs from pids.events:max only when pids.max is configured on
non-leaf cgroups.)

Since it changes semantics of the original "max" event, introduce this
change only in the v2 API of the controller and add a cgroup2 mount
option to revert to the legacy behavior.

Signed-off-by: Michal Koutný <mkoutny@suse.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Documentation/admin-guide/cgroup-v1/pids.rst
Documentation/admin-guide/cgroup-v2.rst
include/linux/cgroup-defs.h
kernel/cgroup/cgroup.c
kernel/cgroup/pids.c