Comments (8)
runs eBPF program, which may drop/modify/add sqes, etc.
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 👍
from liburing.
Сomposability is one of the current topics/issues of interest for io_uring
, but it's not as simple though. It's not feasible to support each of such cases as a separate IOSQE flag in the kernel. It will slow io_uring
down (and please consider that the kernel must not break userspace).
What you really want is to have some ability to control flow depending on e.g. return code. We are thinking about using eBPF
for steering, but don't think libraries such as yours would use it without a really good reason.
Regarding your issue:
- I think the right thing to do is to fail a link, if
ret_size != asked_size
, so letting the userspace to handle this. - As I remember, that's the exactly behaviour for e.g. regular file reads. So, it's not as the same as
read(2)
from liburing.
It will slow io_uring down (and please consider that the kernel must not break userspace)
It's not enabled by default, so it shouldn't break anything
I think the right thing to do is to fail a link, if ret_size != asked_size, so letting the userspace to handle this.
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 IOSQE_IO_USE_PREV_RES
in my opinion, as it still goes back to userland.
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.
As I remember, that's the exactly behaviour for e.g. regular file reads. So, it's not as the same as read(2)
I don't quite understand what you mean.
from liburing.
It's not enabled by default, so it shouldn't break anything
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
read(n) -> read(m) -> write(n+m)
? Or do a tee-like stuff? And there are a lot of cases.
I think the right thing to do is to fail a link, if ret_size != asked_size, so letting the userspace to handle this.
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 asIOSQE_IO_USE_PREV_RES
in my opinion, as it still goes back to userland.
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.
As I remember, that's the exactly behaviour for e.g. regular file reads. So, it's not as the same as read(2)
I don't quite understand what you mean.
IORING_OP_READ* will fail a link, if it read less than was specified.
from liburing.
The approach I'm thinking of is to have a steering opcode with different program making decisions. E.g.
read -> OP_STEERING(1) -> write
as you described... -> OP_STEERING(2) -> ...
runs an eBPF program, which may drop/modify/add sqes, etc.
from liburing.
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.
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
runs eBPF program, which may drop/modify/add sqes, etc.
This is far beyond my knowledge. Does it require the root privilege?
from liburing.
runs eBPF program, which may drop/modify/add sqes, etc.
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.
from liburing.
According to the man page:
a short read will also terminate the remainder of the chain
Never realized that. Awesome!
EDIT: Well, it seems that only IORING_OP_READV
follows this rule, while IORING_OP_RECVMSG
doesn't
from liburing.
Related Issues (20)
- What's the proper way to read all the PID stat files "/proc/[pid]/stat" in a io_uring friendly way? HOT 11
- EAGAINs impacting the performance of io_uring HOT 8
- SPDX license expressions
- SOCKET_URING_OP_GETSOCKOPT hangs HOT 13
- `io_uring_prep_recv` does not return `0`? HOT 2
- Question: will io_uring block in this scenario in the same way as libaio? HOT 7
- io_uring read multishot fails when trying to read a tty HOT 8
- Is there a way to synchronously wait for a completion of a submitted write for a particular FD HOT 2
- redefinition of 'struct in6_pktinfo' when building on ubi7 with gcc/g++ 9.5.0 HOT 5
- Can we know how many bytes we have read by using io_uring_prep_readv method? HOT 1
- RCU calls made by the NAPI busy poll code generates context switches occupying 50% of the time of the CPU hosting the sqp thread HOT 92
- Per-iovec zero-copy and fixed buffer settings for writev/sendmsg HOT 5
- possible socket leakage with direct file descriptors HOT 21
- Ordering guarantees between accept and close? HOT 11
- SYSCHK(syscall(__NR_io_uring_setup, 10, ¶ms)): Invalid argument HOT 3
- io_uring openat non-existing file, cqe->res returns -2, outside of specification HOT 2
- io_uring_prep_recv with IORING_RECVSEND_BUNDLE always fills only one buffer at a time HOT 13
- io_uring_prep_send_bundle should not have len argument HOT 5
- Wrong number of arguments in io_uring_prep_fixed_fd_install man
- test buf-ring-nommap.t failed with -12 (-ENOMEM) in ppc64le arch.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from liburing.