Ai
11 Star 0 Fork 21

src-anolis-os/liburing

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
1002-support-us-granularity-of-io_sq_thread_idle.patch 1.83 KB
一键复制 编辑 原始数据 按行查看 历史
From 5c31734118432639f7758d4671f1f05348914d63 Mon Sep 17 00:00:00 2001
From: Hao Xu <haoxu@linux.alibaba.com>
Date: Mon, 10 May 2021 11:34:29 +0800
Subject: [PATCH 2/4] support us granularity of io_sq_thread_idle
add flag IORING_SETUP_IDLE_US to support microsecond granularity
io_sq_thread_idle.
Signed-off-by: Hao Xu <haoxu@linux.alibaba.com>
---
man/io_uring_setup.2 | 8 +++++++-
src/include/liburing/io_uring.h | 1 +
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/man/io_uring_setup.2 b/man/io_uring_setup.2
index 30a2306..082507c 100644
--- a/man/io_uring_setup.2
+++ b/man/io_uring_setup.2
@@ -83,7 +83,9 @@ doing a single system call.
If the kernel thread is idle for more than
.I sq_thread_idle
-milliseconds, it will set the
+milliseconds/microseconds(depends on if
+.B IORING_SETUP_IDLE_US
+is set), it will set the
.B IORING_SQ_NEED_WAKEUP
bit in the
.I flags
@@ -287,6 +289,10 @@ Note that if this flag is set then it is the application's responsibility to per
trigger work (for example via any of the CQE waiting functions) or else completions may
not be delivered.
Available since 6.1.
+.B IORING_SETUP_IDLE_US
+If this flag is set, the unit of
+.I sq_thread_idle
+is microsecond, rather than millisecond.
.PP
If no flags are specified, the io_uring instance is setup for
interrupt driven I/O. I/O may be submitted using
diff --git a/src/include/liburing/io_uring.h b/src/include/liburing/io_uring.h
index d4a0d83..8291de7 100644
--- a/src/include/liburing/io_uring.h
+++ b/src/include/liburing/io_uring.h
@@ -166,6 +166,7 @@ enum {
* Only one task is allowed to submit requests
*/
#define IORING_SETUP_SINGLE_ISSUER (1U << 12)
+#define IORING_SETUP_IDLE_US (1U << 30) /* unit of thread_idle is microsecond */
/* use percpu SQ poll thread */
#define IORING_SETUP_SQPOLL_PERCPU (1U << 31)
--
2.31.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-anolis-os/liburing.git
git@gitee.com:src-anolis-os/liburing.git
src-anolis-os
liburing
liburing
a8

搜索帮助