axboe / liburing

Library providing helpers for the Linux kernel io_uring support
MIT License
2.86k stars 402 forks source link

io_uring_register_ring_fd fails with EINVAL on 5.15, but not on 6.9.5 #1240

Closed Oipo closed 1 month ago

Oipo commented 1 month ago

I have a program that running on 6.9 works fine but on 5.15 fails to register a ring fd. Could it be that io_uring_register_ring_fd is only available in later kernels? I couldn't information on since which version it is available, so I assumed it would work regardless of kernel version.

$ uname -r
5.15.0-122-generic
axboe commented 1 month ago

I added a blurb to the man page about when it became available - it was in 5.18, which is why it doesn't work for you with 5.15. There's a necessary kernel component that needs to be in place for this kernel. In terms of backward compatibility for an application, it'd be fine to just ignore a failure to register the ring fd. It will not functionally impact anything, just will not get the optimization that's available in newer kernels.