On Fri, 24 Jan 2020 at 10:16, Jens Axboe <axboe@xxxxxxxxx> wrote: > > Sometimes an applications wants to use multiple smaller rings, because > it's more efficient than sharing a ring. The downside of that is that > we'll create the io-wq backend separately for all of them, while they > would be perfectly happy just sharing that. > > This patchset adds support for that. io_uring_params grows an 'id' field, > which denotes an identifier for the async backend. If an application > wants to utilize sharing, it'll simply grab the id from the first ring > created, and pass it in to the next one and set IORING_SETUP_SHARED. This > allows efficient sharing of backend resources, while allowing multiple > rings in the application or library. > > Not a huge fan of the IORING_SETUP_SHARED name, we should probably make > that better (I'm taking suggestions). I don't love the idea of some new type of magic user<>kernel identifier. It would be nice if the id itself was e.g. a file descriptor What if when creating an io_uring you could pass in an existing io_uring file descriptor, and the new one would share the io-wq backend?