On Fri, May 29, 2020 at 12:54:19AM -0700, Andrii Nakryiko wrote: > Implement a new BPF ring buffer, as presented at BPF virtual conference ([0]). > It presents an alternative to perf buffer, following its semantics closely, > but allowing sharing same instance of ring buffer across multiple CPUs > efficiently. > > Most patches have extensive commentary explaining various aspects, so I'll > keep cover letter short. Overall structure of the patch set: > - patch #1 adds BPF ring buffer implementation to kernel and necessary > verifier support; > - patch #2 adds libbpf consumer implementation for BPF ringbuf; > - patch #3 adds selftest, both for single BPF ring buf use case, as well as > using it with array/hash of maps; > - patch #4 adds extensive benchmarks and provide some analysis in commit > message, it builds upon selftests/bpf's bench runner. > - patch #5 adds most of patch #1 commit message as a doc under > Documentation/bpf/ringbuf.rst. > > Litmus tests, validating consumer/producer protocols and memory orderings, > were moved out as discussed in [1] and are going to be posted against -rcu > tree and put under Documentation/litmus-tests/bpf-rb. > > [0] https://docs.google.com/presentation/d/18ITdg77Bj6YDOH2LghxrnFxiPWe0fAqcmJY95t_qr0w > [1] https://lkml.org/lkml/2020/5/22/1011 > > v3->v4: > - fix ringbuf freeing (vunmap, __free_page); verified with a trivial loop > creating and closing ringbuf map endlessly (Daniel); Applied, thanks!