代码拉取完成,页面将自动刷新
同步操作将从 openEuler/wayca-scheduler 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
/*
* Copyright (c) 2021 HiSilicon Technologies Co., Ltd.
* Wayca scheduler is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
*
* See the Mulan PSL v2 for more details.
*/
#ifndef DEPLOY_COMMON_H
#define DEPLOY_COMMON_H
#include <string.h>
#include "lib/common.h"
#define MAX_IRQS_BIND 20
/*
* memory bandwidth requirement of the application
* LOW: we don't care about bandwidth, for this, we can organize process in one CCL
* DIE: we are going to split threads to the NUMA node for low memory bandwidth
* PACKAGE: we are going to use memory controllers in multiple NUMA nodes in one package
* ALL: we are going to all memory controller
*/
enum MEMBAND {LOW = 0, DIE, PACKAGE, ALL};
static const char *memband_string[] = {
[LOW] = "LOW",
[DIE] = "DIE",
[PACKAGE] = "PACKAGE",
[ALL] = "ALL",
};
/*
* CPU binding modes
* AUTO: let wayca-deployd bind the whole process to CCL, NODE, PACKAGE based on IO node
* COARSE: wayca-deployer won't differentiate each thread in one process
* FINE: for threads created by wayca_managed_thread APIs, wayca-deployer can do fine-
* grained binding for each thread or threadpool
*/
enum CPUBIND {AUTO = 0, COARSE, FINE};
static const char *cpubind_string[] = {
[AUTO] = "AUTO",
[COARSE] = "DIE",
[FINE] = "FINE",
};
struct program {
pid_t pid;
char exec[PATH_MAX];
char cpu_list[PATH_MAX];
int irq_bind[MAX_IRQS_BIND][2];
int cpu_util;
int io_node;
enum CPUBIND task_bind_mode;
enum MEMBAND mem_band;
};
static inline int cfg_strtostr(char *buf, char *str)
{
char *p;
p = strchr(buf, '\n');
if (p)
*p = 0;
p = strchr(buf, '=');
if (!p)
return -1;
snprintf(str, PATH_MAX, "%s", p + 1);
return 0;
}
static inline bool str_start_with(const char *str, const char *start)
{
return !strncmp(str, start, strlen(start));
}
static inline void cfg_strtocpubind(const char *str, enum CPUBIND *cpubind)
{
int i;
for (i = 0; i < sizeof(cpubind_string) / sizeof(cpubind_string[0]); i++)
if (!strcmp(str, cpubind_string[i])) {
*cpubind = i;
break;
}
}
static inline void cfg_strtomemband(const char *str, enum MEMBAND *memband)
{
int i;
for (i = 0; i < sizeof(memband_string) / sizeof(memband_string[0]); i++)
if (!strcmp(str, memband_string[i])) {
*memband = i;
break;
}
}
#endif
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。