1 Star 0 Fork 32

吴昌盛/gazelle-tar

forked from src-openEuler/gazelle 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0021-fix-pasre-numacpulist.patch 1.60 KB
一键复制 编辑 原始数据 按行查看 历史
jinag12 提交于 2022-03-16 22:23 . fix gazelle test issue
From ce951a907f5634e8502d28fb66ae79a3a3c82689 Mon Sep 17 00:00:00 2001
From: wuchangsheng <wuchangsheng2@huawei.com>
Date: Fri, 11 Mar 2022 21:19:19 +0800
Subject: [PATCH 21/34] fix pasre numacpulist
---
src/lstack/core/lstack_cfg.c | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/src/lstack/core/lstack_cfg.c b/src/lstack/core/lstack_cfg.c
index e5a92ca..058a392 100644
--- a/src/lstack/core/lstack_cfg.c
+++ b/src/lstack/core/lstack_cfg.c
@@ -323,25 +323,22 @@ static int32_t numa_to_cpusnum(unsigned socket_id, uint32_t *cpulist, int32_t nu
static int32_t stack_idle_cpuset(struct protocol_stack *stack, cpu_set_t *exclude)
{
- int32_t cpunum;
uint32_t cpulist[CPUS_RANGE_NUM];
- cpunum = numa_to_cpusnum(stack->socket_id, cpulist, CPUS_RANGE_NUM);
- if (cpunum <= 0 || cpunum % 2 != 0) { // 2 : even
+ int32_t cpunum = numa_to_cpusnum(stack->socket_id, cpulist, CPUS_RANGE_NUM);
+ if (cpunum <= 0 ) {
LSTACK_LOG(ERR, LSTACK, "numa_to_cpusnum failed\n");
return -1;
}
CPU_ZERO(&stack->idle_cpuset);
- for (uint32_t n = 0; n < cpunum; n += 2) { // 2 : even
- for (uint32_t i = cpulist[n]; i <= cpulist[n + 1]; i++) {
- /* skip stack cpu */
- if (CPU_ISSET(i, exclude)) {
- continue;
- }
-
- CPU_SET(i, &stack->idle_cpuset);
+ for (int32_t i = 0; i < cpunum; i++) {
+ /* skip stack cpu */
+ if (CPU_ISSET(cpulist[i], exclude)) {
+ continue;
}
+
+ CPU_SET(cpulist[i], &stack->idle_cpuset);
}
return 0;
--
1.8.3.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wu-changsheng/gazelle-tar.git
git@gitee.com:wu-changsheng/gazelle-tar.git
wu-changsheng
gazelle-tar
gazelle-tar
master

搜索帮助