A Linux character driver that maps shared pages into two processes, with a lock-free ring buffer on top and poll/epoll support for blocking.
throughput
24M msg/s
round-trip p50, 43× lower than sockets
252 ns
idle CPU, down from 100%
0.3%
sysipc ring versus Unix domain socket
Transport
Mmsg/s
p50
p99
sysipc ring
23.3
252 ns
384 ns
Unix socket
1.62
10.9 µs
55.7 µs
Against a Unix domain socket, the fastest socket Linux offers. 64-byte messages, medians of 20 runs.
Mechanism
A custom mmap handler allocates, splits and refcounts physical pages into userspace with alloc_pages, split_page and vm_insert_page. The ring is single-producer single-consumer on C11 acquire/release atomics, checked with 10M-message strict-ordering tests.
The hard part
Blocking without burning a core. A kernel wait queue plus a shared wait flag and adaptive spinning removed 99.2% of wakeup syscalls, and getting it right meant fixing a StoreLoad race that acquire/release ordering does not cover.
Throughput by spin limit
Spin limit
Mmsg/s
10
6.37
50
14.5
100
17.06
500
17.3
1000
16.7
2000
17.91
5000
17.11
10000
17.2
Spinning briefly before sleeping. Past ~100 iterations the budget stops mattering.
Throughput and idle CPU by consumer strategy
Mode
Mmsg/s
Idle CPU
Spin only
24.06
~100% idle CPU
poll, kick on every push
3.46
~0.3% idle CPU
poll, conditional kick + adaptive spin
17.3
~0.3% idle CPU
Three ways to block. The last keeps 72% of spinning throughput at 0.3% idle CPU.