Replies: 4 comments
-
I think you'd need the BPF io_uring patches for this, don't see how else you could do something like this. |
Beta Was this translation helpful? Give feedback.
-
I am not really sure what that would entail. The way I was thinking about it was that Lets take @axboe I just hope you can see how this feature can change the way computing will work in the future. If you think about it... we could have multiple user-space software running and submitting work into same If there are some kind of technical limitation, do mention it here, so we can further flush out the idea. |
Beta Was this translation helpful? Give feedback.
-
@YoSTEALTH, the problem here is that io-wq runs in the kernel space and obviously it can't execute arbitrary userspace code. One way is to make the thread to switch into the userspace and execute it, but the overhead on switching will most probably be intolerable. Another way, mentioned by Jens, is to execute it in the kernel space but limit what programs can be run, take a look what eBPF is. It was actually tried out, see [1], though it doesn't bring as much performance as we'd wish, and so got frozen until a better moment. |
Beta Was this translation helpful? Give feedback.
-
Aww, I should have guessed you guys would have already thought of such ideas ;)
Right
Good to see you have already tested this.
Yes, this is more or less what I am suggesting as well. Make a callback function so limited that it can either only be sent data previously processed using other Another approach would be something like // in liburing
sqe = io_uring_get_sqe(&ring)
io_uring_prep_recv(sqe, sock_fd, buffer, ...)
sqe = io_uring_get_sqe(&ring)
io_uring_prep_regex(sqe, 'my-regex-syntax', buffer, ...)
// here we could be parsing http header info received. // in io_uring - run this code in its own thread till the task is done.
int io_uring_prep_regex(regex, buffer):
// here we would be manipulate buffer with regex
return 123 Most of the time when people are trying to use threads its normally to crunch data. With such limited type of workload passed to kernel side, there shouldn't be a problem?
Wrapping a eBPF would be way too much work at this point, since I am pretty much close to done with uring project.
I see, seems like you did a lot of work on it! Sorry, I can't comment much on eBPF project. |
Beta Was this translation helpful? Give feedback.
-
This is just a ruff sketch. Allowing user to submit a callback function into
io_uring
will solve a lot of issues currently users are having. This literally makes kernel side utilize most of the cpu and make user-space more of a managerial area!. Now we don't have to split resources into kernel and user-side workers, only kernel side. Possibilities becomes endless...Beta Was this translation helpful? Give feedback.
All reactions