On Wed, Feb 22, 2023 at 7:07 PM Alexei Starovoitov <alexei.starovoitov@xxxxxxxxx> wrote: > > diff --git a/tools/lib/bpf/bpf_helpers.h b/tools/lib/bpf/bpf_helpers.h > index 7d12d3e620cc..affc0997f937 100644 > --- a/tools/lib/bpf/bpf_helpers.h > +++ b/tools/lib/bpf/bpf_helpers.h > @@ -176,6 +176,7 @@ enum libbpf_tristate { > #define __ksym __attribute__((section(".ksyms"))) > #define __kptr_untrusted __attribute__((btf_type_tag("kptr_untrusted"))) > #define __kptr __attribute__((btf_type_tag("kptr"))) > +#define __kptr_rcu __attribute__((btf_type_tag("kptr_rcu"))) Realized that the mechanism can work without requiring bpf prog to use this new tag. The kernel can determine whether __kptr is RCU or not via rcu_protected_object(). So BPF_KPTR_RCU vs BPF_KPTR_REF will be kernel internal distinction. Eventually all __kptr kernel objects will be RCU anyway. I'll respin.