On Sun, Nov 24, 2019 at 07:55:07AM +0100, Björn Töpel wrote: > > > > I think I got it why it works. > > Every time the prog cnt goes to zero you free the trampoline right away > > and next time it will be allocated again and kzalloc() will zero selector. > > That's hard to spot. > > Also if user space does for(;;) attach/detach; > > it will keep stressing bpf_jit_alloc_exec. > > In case of bpf trampoline attach/detach won't be stressing it. > > Only load/unload which are much slower due to verification. > > I guess such difference is ok. > > > > Alexei, thanks for all feedback (on the weekend)! I agree with all of > above, and especially missing selftests and too much code duplication. > > I'll do a respin, but that'll be in the next window, given that Linus > will (probably) tag the release today. I want it to land just as much as you do :) Two weeks is not a big deal. We backport all of bpf and xdp as soon as it lands in bpf-next/net-next. We don't wait for patches to reach Linus's tree. So this dispatch logic will be running on our servers way sooner than you'd expect. I guess that explains my obsession with quality. Same goes for libbpf.