Ai
11 Star 0 Fork 21

src-anolis-os/liburing

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
1001-Add-percpu-io-sq-thread-support.patch 1.95 KB
一键复制 编辑 原始数据 按行查看 历史
From cd0ee5df307beda0cc8a14af09ffdaafcd5e0e6a Mon Sep 17 00:00:00 2001
From: Xiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
Date: Thu, 6 Aug 2020 14:23:01 +0800
Subject: [PATCH 1/4] Add percpu io sq thread support
Add a new IORING_SETUP_SQPOLL_PERCPU flag, this flag is only meaningful
when IORING_SETUP_SQPOLL and IORING_SETUP_SQ_AFF are both specified, that
means if user creates multiple io_uring instances which are all bound
to one same cpu, only a kernel thread is created for this cpu to perform
these io_uring instances' submission queue polling.
Signed-off-by: Xiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
Acked-by: Joseph Qi <joseph.qi@linux.alibaba.com>
---
man/io_uring_setup.2 | 9 +++++++++
src/include/liburing/io_uring.h | 2 ++
2 files changed, 11 insertions(+)
diff --git a/man/io_uring_setup.2 b/man/io_uring_setup.2
index cd69994..30a2306 100644
--- a/man/io_uring_setup.2
+++ b/man/io_uring_setup.2
@@ -147,6 +147,15 @@ is specified. When cgroup setting
changes (typically in container environment), the bounded cpu set may be
changed as well.
.TP
+.B IORING_SETUP_SQPOLL_PERCPU
+This flag is only meaningful when
+.B IORING_SETUP_SQPOLL
+and
+.B IORING_SETUP_SQ_AFF
+are both specified, that means if user creates multiple io_uring instances
+which are all bound to one same cpu, only a kernel thread is created for this
+cpu to perform these io_uring instances' submission queue polling.
+.TP
.B IORING_SETUP_CQSIZE
Create the completion queue with
.IR "struct io_uring_params.cq_entries"
diff --git a/src/include/liburing/io_uring.h b/src/include/liburing/io_uring.h
index a3e0920..d4a0d83 100644
--- a/src/include/liburing/io_uring.h
+++ b/src/include/liburing/io_uring.h
@@ -166,6 +166,8 @@ enum {
* Only one task is allowed to submit requests
*/
#define IORING_SETUP_SINGLE_ISSUER (1U << 12)
+/* use percpu SQ poll thread */
+#define IORING_SETUP_SQPOLL_PERCPU (1U << 31)
/*
* Defer running task work to get events.
--
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

搜索帮助