You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
introduce BPF_F_ALLOW_MULTI flag that can be used to attach multiple
bpf programs to a cgroup.
The difference between three possible flags for BPF_PROG_ATTACH command:
- NONE(default): No further bpf programs allowed in the subtree.
- BPF_F_ALLOW_OVERRIDE: If a sub-cgroup installs some bpf program,
the program in this cgroup yields to sub-cgroup program.
- BPF_F_ALLOW_MULTI: If a sub-cgroup installs some bpf program,
that cgroup program gets run in addition to the program in this cgroup.
NONE and BPF_F_ALLOW_OVERRIDE existed before. This patch doesn't
change their behavior. It only clarifies the semantics in relation
to new flag.
Only one program is allowed to be attached to a cgroup with
NONE or BPF_F_ALLOW_OVERRIDE flag.
Multiple programs are allowed to be attached to a cgroup with
BPF_F_ALLOW_MULTI flag. They are executed in FIFO order
(those that were attached first, run first)
The programs of sub-cgroup are executed first, then programs of
this cgroup and then programs of parent cgroup.
All eligible programs are executed regardless of return code from
earlier programs.
To allow efficient execution of multiple programs attached to a cgroup
and to avoid penalizing cgroups without any programs attached
introduce 'struct bpf_prog_array' which is RCU protected array
of pointers to bpf programs.
Signed-off-by: Alexei Starovoitov <[email protected]>
Acked-by: Daniel Borkmann <[email protected]>
Acked-by: Martin KaFai Lau <[email protected]>
for cgroup bits
Acked-by: Tejun Heo <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
(cherry picked from commit 324bda9)
Orabug: 31667601
Signed-off-by: Alan Maguire <[email protected]>
Reviewed-by: Mark Haywood <[email protected]>
Conflicts:
kernel/cgroup/cgroup.c
include/linux/bpf-cgroup.h
context differences around out_* labels in cgroup_create() in cgroup.c
KABI replacement/extensions to "struct cgroup_bpf" which involved reordering
the fields such that the order matches previous version of the struct;
progs and effective fields are reordered wrt upstream to match previous
order and flags field replaces the bool disallow_override field; finally
the inactive progs array is appended.
Signed-off-by: Somasundaram Krishnasamy <[email protected]>
0 commit comments