On 10/2/17 9:21 PM, Alexei Starovoitov wrote: > > i'm not sure what you're trying to say. > The first loop quoted above is inside cgroup_bpf_put() > which is called when cgroup is destroyed. At this point > we're detaching and prog_put all attached programs. > While there is only one static_branch_inc() in __cgroup_bpf_attach() > that is called every time the prog is attached to a cgroup. > So what's the concern?
just asking if cgroup_bpf_enabled_key is 0 when all programs are removed -- ie., that the inc's and dec's are equal. Reviewing this patch it was not clear that they are. > Note we're doing branch_dec only for progs in prog_list. > Just like we do branch_inc only for progs in prog_list. > Computing prog_array doesn't involve manipulations with prog's refcnt > and no branch_inc/dec either. >