36 ms·
You have to allocate buffer per socket with io_uring, rather then reuse for each one that is ready. Most applications do this anyway though.
by wbl 7y ago
You have to allocate buffer per socket with io_uring, rather then reuse for each one that is ready. Most applications do this anyway though.
- GrayShade 7y agoThis is addressed in the article comments: https://lwn.net/Articles/810558/ https://lwn.net/Articles/810558/.
- yxhuvud 7y agoEh, nothing stops you from using a single buffer, but with different offsets for each open call. So I don't really see the problem unless you have so much buffer space allocated that it becomes problematic.
- cesarb 7y agoA "single buffer, but with different offsets for each open call" is identical to "allocate one buffer per socket" (you "allocated" the per-socket buffer by subdividing a larger allocation). And even if you don't "have so much buffer space allocated that it becomes problematic", it's still a waste of memory.
- gpderetta 7y agoI think the usual trick of using 0 sized buffers for readiness and just do the read synchronously might work. In fact io_uring might have direct support for polling now.