On Tue, Nov 16, 2021 at 05:31:14PM -0800, Andrii Nakryiko wrote: > > + } > > + } > > + err = bpf_core_apply_relo_insn((void *)log, insn, relo->insn_off / 8, > > + relo, relo_idx, btf, cands); > > + bpf_core_free_cands(cands); > > Why did you decide to not persist the candidate list? It is a > significant slowdown even on moderately large BPF programs, as you are > linearly re-searching vmlinux BTF multiple times for the same root > type. Somehow I convinced myself that it's not a correct thing to do across multiple relocations. Yeah. Will move the free to be after the loop.