On Fri, 22 Nov 2024 at 01:24, Alexei Starovoitov <alexei.starovoitov@xxxxxxxxx> wrote: > > On Wed, Nov 20, 2024 at 4:53 PM Kumar Kartikeya Dwivedi > <memxor@xxxxxxxxx> wrote: > > > > With the commit f6b9a69a9e56 ("bpf: Refactor active lock management"), > > we have begun using the acquired_refs array to also store active lock > > metadata, as a way to consolidate and manage all kernel resources that > > the program may acquire. > > > > This is beginning to cause some confusion and duplication in existing > > code, where the terms references now both mean lock reference state and > > the references for acquired kernel object pointers. To clarify and > > improve the current state of affairs, as well as reduce code duplication, > > make the following changes: > > > > Rename bpf_reference_state to bpf_resource_state, and begin using > > resource as the umbrella term. This terminology matches what we use in > > check_resource_leak. Next, "reference" now only means RES_TYPE_PTR, and > > the usage and meaning is updated accordingly. > > > Sorry I don't like this renaming. > reference state is already understood as a set of resources that > were acquired. > Whether it's an object allocated by bpf_obj_new or any other > resource. > I think this patch has a net negative effect. > People familiar with the verifier already understand what > refsafe() or acquired_refs are for. > Calling them slightly different names adds confusion, not clarity. > > pw-bot: cr Ok