|
|
Log in / Subscribe / Register

The rapid growth of io_uring

The rapid growth of io_uring

Posted Jan 25, 2020 0:23 UTC (Sat) by josh (subscriber, #17465)
Parent article: The rapid growth of io_uring

> In Metzmacher's case, he would like to call openat() asynchronously, then submit I/O operations on the resulting file descriptor without waiting for the open to complete.

The X Window System solved this decades ago: applications specify the ID they want when creating an object in X, for precisely this reason.

Let the application specify the file descriptor it wants to open, so that it knows what fd number it'll get, and can submit subsequent operations on that file descriptor in the same queue.


to post comments

The rapid growth of io_uring

Posted Jan 30, 2020 12:05 UTC (Thu) by Karellen (subscriber, #67644) [Link] (6 responses)

What if that fd is already in use?

The rapid growth of io_uring

Posted Jan 30, 2020 14:39 UTC (Thu) by Baughn (subscriber, #124425) [Link] (3 responses)

The call fails, and you get to fix your code. The IDs should be per-process.

The rapid growth of io_uring

Posted Jan 30, 2020 23:51 UTC (Thu) by Karellen (subscriber, #67644) [Link] (2 responses)

Fix your code? But...

Even per-process, how do you know which fds are free?

Are you suggesting that you should enumerate all the fds currently in use by your program, and then make sure to pick one that you know isn't being used, and hope that another thread doesn't race you to getting it anyway?

Sorry, I think I'm missing an important part of the puzzle somewhere here.

The rapid growth of io_uring

Posted Jan 31, 2020 10:39 UTC (Fri) by klempner (subscriber, #69940) [Link]

You would presumably use an allocator for this, perhaps one that is part of libc.

That allocator wouldn't allocate the same fd twice without a deallocate and could be made threadsafe so you wouldn't have race issues.

The rapid growth of io_uring

Posted Feb 6, 2020 17:26 UTC (Thu) by Wol (subscriber, #4433) [Link]

> Even per-process, how do you know which fds are free?

Run FORTRAN???

That's the way that always worked :-)

Cheers,
Wol

The rapid growth of io_uring

Posted Feb 7, 2020 8:08 UTC (Fri) by renox (guest, #23785) [Link] (1 responses)

Mmm, let's add a "allocate_fd" system call, so now first you allocate/reserve a fd (very fast, you could even preallocate them), then you provide it to the different system calls .. which now have to add additional checks of course.
No way, this will happen but that's an interesting WHAT-IF design change.

The rapid growth of io_uring

Posted Feb 7, 2020 14:41 UTC (Fri) by canoon (guest, #109743) [Link]

All you really need is a range that is reserved for user space allocation. It of course doesn't solve issues around reusing data between requests though.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds