• Michal Koutný's avatar
    cgroup/pids: Separate semantics of pids.events related to pids.max · 73e75e6f
    Michal Koutný authored
    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: default avatarMichal Koutný <mkoutny@suse.com>
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    73e75e6f
cgroup.c 185 KB