On Tue, May 14, 2019 at 07:56:36PM -0700, Stanislav Fomichev wrote: > On 05/14, Eric Dumazet wrote: > > > > > > On 5/14/19 7:27 PM, Alexei Starovoitov wrote: > > > > > what about activate_effective_progs() ? > > > I wouldn't want to lose the annotation there. > > > but then array_free will lose it? > It would not have have it because the input is the result of > bpf_prog_array_alloc() which returns kmalloc'd pointer (and > is not bound to an rcu section). > > > > in some cases it's called without mutex in a destruction path. > Hm, can you point me to this place? I think I checked every path, > maybe I missed something subtle. I'll double check. I thought cgroup dying thingy is not doing it, but looks like it is. > > > also how do you propose to solve different 'mtx' in > > > lockdep_is_held(&mtx)); ? > > > passing it through the call chain is imo not clean. > Every caller would know which mutex protects it. As Eric said below, > I'm adding a bunch of xxx_dereference macros that hardcode mutex, like > the existing rtnl_dereference. I have a hard time imagining how it will look without being a mess. There are three mutexes to pass down instead of single rtnl_derefernce: cgroup_mutex, ir_raw_handler_lock, bpf_event_mutex. Anyway, let's see how the patches look and discuss further.