tokio-rs / tokio-uring

An io_uring backed runtime for Rust
MIT License
1.11k stars 117 forks source link

__io_uring_buf_ring_cq_advance broken? #293

Closed SUPERCILEX closed 7 months ago

SUPERCILEX commented 7 months ago

https://github.com/axboe/liburing/blob/f31f86851ba655b9ddce9c0cd200668a4944b2cc/src/include/liburing.h#L1462-L1468

I'm confused, isn't this totally broken? If you context switch between the tail update and the cq atomic store, what prevents the stores to io_uring_buf from being reordered? As in what prevents the store to the tail being seen before the stores to update io_uring_buf, in which case the ring will contain garbage.

SUPERCILEX commented 7 months ago

Ah crap, wrong repo.