On Thu, May 21, 2020 at 5:34 PM Paul E. McKenney <paulmck@xxxxxxxxxx> wrote: > > On Sun, May 17, 2020 at 12:57:22PM -0700, Andrii Nakryiko wrote: > > Add 4 litmus tests for BPF ringbuf implementation, divided into two different > > use cases. > > > > First, two unbounded case, one with 1 producer and another with > > 2 producers, single consumer. All reservations are supposed to succeed. > > > > Second, bounded case with only 1 record allowed in ring buffer at any given > > time. Here failures to reserve space are expected. Again, 1- and 2- producer > > cases, single consumer, are validated. > > > > Just for the fun of it, I also wrote a 3-producer cases, it took *16 hours* to > > validate, but came back successful as well. I'm not including it in this > > patch, because it's not practical to run it. See output for all included > > 4 cases and one 3-producer one with bounded use case. > > > > Each litmust test implements producer/consumer protocol for BPF ring buffer > > implementation found in kernel/bpf/ringbuf.c. Due to limitations, all records > > are assumed equal-sized and producer/consumer counters are incremented by 1. > > This doesn't change the correctness of the algorithm, though. > > Very cool!!! > > However, these should go into Documentation/litmus-tests/bpf-rb or similar. > Please take a look at Documentation/litmus-tests/ in -rcu, -tip, and > -next, including the README file. > > The tools/memory-model/litmus-tests directory is for basic examples, > not for the more complex real-world ones like these guys. ;-) Oh, ok, I didn't realize there are more litmus tests under Documentation/litmus-tests... Might have saved me some time (more examples to learn from!) when I was writing mine :) Will check those and move everything. > > Thanx, Paul > [...]