代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/libwd 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 4a15745d3544eae2c41419d5fb64802e2a16a9f5 Mon Sep 17 00:00:00 2001
From: Wenkai Lin <linwenkai6@hisilicon.com>
Date: Thu, 30 Dec 2021 12:07:31 +0800
Subject: [PATCH 19/28] uadk: fix numa array use too much stack space
numa array will take 32768 bytes, too big for
a process, replace it by check numa invalid status.
Signed-off-by: Wenkai Lin <linwenkai6@hisilicon.com>
---
wd_sched.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/wd_sched.c b/wd_sched.c
index 3330a4d..f97c15f 100644
--- a/wd_sched.c
+++ b/wd_sched.c
@@ -202,10 +202,8 @@ static int session_sched_poll_policy(handle_t sched_ctx,
{
struct wd_sched_ctx *ctx = (struct wd_sched_ctx *)sched_ctx;
struct wd_sched_info *sched_info;
- __u16 numa[NUMA_NUM_NODES];
__u32 loop_time = 0;
__u32 last_count = 0;
- __u16 tail = 0;
__u16 i;
int ret;
@@ -220,9 +218,6 @@ static int session_sched_poll_policy(handle_t sched_ctx,
}
sched_info = ctx->sched_info;
- for (i = 0; i < ctx->numa_num; i++)
- if (sched_info[i].valid)
- numa[tail++]= i;
/*
* Try different numa's ctx if we can't receive any
@@ -231,15 +226,25 @@ static int session_sched_poll_policy(handle_t sched_ctx,
*/
while (loop_time < MAX_POLL_TIMES) {
loop_time++;
- for (i = 0; i < tail;) {
+ for (i = 0; i < ctx->numa_num;) {
+ /* If current numa is not valid, find next. */
+ if (!sched_info[i].valid) {
+ i++;
+ continue;
+ }
+
last_count = *count;
- ret = session_poll_policy_rr(ctx, numa[i], expect, count);
+ ret = session_poll_policy_rr(ctx, i, expect, count);
if (ret)
return ret;
if (expect == *count)
return 0;
+ /*
+ * If no package is received, find next numa,
+ * otherwise, keep receiving packets at this node.
+ */
if (last_count == *count)
i++;
}
--
2.31.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。