Io_uring is not (only) a generic asynchronous syscall facility
This is a short article but the way it introduces the concepts of control plane and data plane is worth thinking about.<p>To elaborate:<p>In the abstract, the control plane is just anything that&#x27;s not in the critical data path, it&#x27;s safety critical but not performance critical, whereas the data plane has the inverse profile. For example, it would be fine to have (and one would want) plenty of assertions in the control plane for safety.<p>Whereas the data plane is in the critical path with huge volumes flowing through it. Here in the data plane one would want to optimize for performance: cache misses, context switches, branch mispredicts etc. The data plane would be like a water mains pipeline, there&#x27;s nothing inside to obstruct flow. The control plane would be all the safety checks you do outside the pipeline as an operator, the little control box that adjusts pressure and controls the pipeline.<p>Having this clean split between control plane and data plane in the design provides both safety and performance without compromising either.<p>As a concrete example of this technique, in TigerBeetle [1], we have around 10,000 financial transactions in a batch. A single-threaded control plane is responsible for switching each of these batches through the consensus protocol, and we amortize all runtime bounds checks, assertions, syscalls and I&#x2F;O across the batch, so that these become almost free, yet we have literally hundreds of assertions, and we&#x27;re doing O_DSYNC on every write. And of course, all of this is running through io_uring so we can drive decent io depth to NVME or SSD without the overhead of context switches and complexity of any user space thread pool.<p>io_uring is such a great design. Not only because it&#x27;s fast, but because it&#x27;s so simple with such a clean separation between control and data planes. It makes pure thread-per-core designs easily achievable with fantastic performance.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;coilhq&#x2F;tigerbeetle" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;coilhq&#x2F;tigerbeetle</a>