diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2023-04-18 12:32:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-18 12:32:08 +0200 |
commit | d2c31f429b87b476a7f1344d145dad4752a406d4 (patch) | |
tree | 1fe1a600c7f93871a2b57a3fe6d7ef26e2494e6b /src/threadpool.c | |
parent | cb5da592268551592f86b291652193f23270a8cb (diff) | |
download | libuv-d2c31f429b87b476a7f1344d145dad4752a406d4.tar.gz libuv-d2c31f429b87b476a7f1344d145dad4752a406d4.zip |
linux: introduce io_uring support (#3952)
Add io_uring support for several asynchronous file operations:
- read, write
- fsync, fdatasync
- stat, fstat, lstat
io_uring is used when the kernel is new enough, otherwise libuv simply
falls back to the thread pool.
Performance looks great; an 8x increase in throughput has been observed.
This work was sponsored by ISC, the Internet Systems Consortium.
Fixes: https://github.com/libuv/libuv/issues/1947
Diffstat (limited to 'src/threadpool.c')
-rw-r--r-- | src/threadpool.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/threadpool.c b/src/threadpool.c index a3da5302..42322ebb 100644 --- a/src/threadpool.c +++ b/src/threadpool.c @@ -275,9 +275,13 @@ void uv__work_submit(uv_loop_t* loop, } +/* TODO(bnoordhuis) teach libuv how to cancel file operations + * that go through io_uring instead of the thread pool. + */ static int uv__work_cancel(uv_loop_t* loop, uv_req_t* req, struct uv__work* w) { int cancelled; + uv_once(&once, init_once); /* Ensure |mutex| is initialized. */ uv_mutex_lock(&mutex); uv_mutex_lock(&w->loop->wq_mutex); |