• Aleksa Sarai's avatar
    cgroup: use bitmask to filter for_each_subsys · 4bb916c1
    Aleksa Sarai authored
    [ Upstream commit cb4a3167 ]
    
    Add a new macro for_each_subsys_which that allows all enabled cgroup
    subsystems to be filtered by a bitmask, such that mask & (1 << ssid)
    determines if the subsystem is to be processed in the loop body (where
    ssid is the unique id of the subsystem).
    
    Also replace the need_forkexit_callback with two separate bitmasks for
    each callback to make (ss->{fork,exit}) checks unnecessary.
    
    tj: add a short comment for "if (!CGROUP_SUBSYS_COUNT)".
    Signed-off-by: default avatarAleksa Sarai <cyphar@cyphar.com>
    Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
    4bb916c1
cgroup.c 152 KB