-
Notifications
You must be signed in to change notification settings - Fork 413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discussion: write/send number of bytes based on previous read/recv result for IOSQE_IO_LINK #58
Comments
Сomposability is one of the current topics/issues of interest for What you really want is to have some ability to control flow depending on e.g. return code. We are thinking about using Regarding your issue:
|
It's not enabled by default, so it shouldn't break anything
You still need an extra flag, or it will result in user-aware behavior change, which may break existing code. In addition, it's not useful as What I want to suggest is to make echo server can be implemented in zero copy manner, which should generally extend the use cases of IOSQE_IO_LINK.
I don't quite understand what you mean. |
What I mean, is that a flag can't be removed in the future. And the kernel would need to analyse every such flag, and that's slow. So, instead of adding a new flag for each such case, I would prefer to have something generic/programmable. E.g. what if you don't want to proceed, if didn't read enough? What if you have
Right, but it's generic. After getting to the userspace you can program the behaviour whatever you want. Would love to see performance difference though.
IORING_OP_READ* will fail a link, if it read less than was specified. |
The approach I'm thinking of is to have a steering opcode with different program making decisions. E.g.
|
Well yes. And it can still be used for zero copy manner. Just submit multiple small buffer recv-send requests. Users only need to handle the last send operation. But the requirement is that the kernel still needs to return the number of bytes it has read successfully
This is far beyond my knowledge. Does it require the root privilege? |
I think some popular cases (like yours) to be available for non-root users (e.g. kind of pre-registered). And if you want something more fancy (i.e. custom in-kernel steering logic), you'd probably need the root privilege. Though, it yet to be discussed and designed, and that's why I would like to see use cases and needs. |
I'd say it will be the most powerful feature I will ever see since io_uring is created if it becomes true 👍 |
According to the man page:
Never realized that. Awesome! EDIT: Well, it seems that only |
One use case for IOSQE_IO_LINK is that zero copy IO operation, but it's hard to determine how many bytes is correctly read.
For example echo server. It's just ACCEPT -> RECV -> SEND -> CLOSE, but it's hard / not possible to do in zero copy way. The problem is:
For 2,
man 2 read
says thatSo that even a simple READ -> WRITE link chain may not always be reliable.
I suggest that add a flag called IOSQE_IO_USE_PREV_RES ( the name is not decided ), which works only with IORING_OP_{WRITE,SEND} must be used together with IOSQE_IO_LINK, indicates that current operation's buffer size is set by previous ret code. If previous ret code <= 0 the operation should generate an error.
What do you think?
The text was updated successfully, but these errors were encountered: