提交 a9850de3 编写于 作者: L Lijun Fang 提交者: Zheng Zengkai

mm: Add DDR and HBM to nodes by cmdline

ascend inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I4JMLR
CVE: NA
---------------------

When the kernel boot, we need to determine DDR or HBM,
and add them to nodes by parse cmdline, instead of memory hotplug.
Signed-off-by: NLijun Fang <fanglijun3@huawei.com>
Reviewed-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 c80f1cb2
...@@ -493,6 +493,12 @@ ...@@ -493,6 +493,12 @@
ccw_timeout_log [S390] ccw_timeout_log [S390]
See Documentation/s390/common_io.rst for details. See Documentation/s390/common_io.rst for details.
cdm-nodes= [KNL]
Format: hexadecimal expression
One bit express one node, if the node is HBM, set the
bit to 1. Then transform Binary to hexadecimal.
Example: node1, node2 is HBM, cdm-nodes=0x06.
cgroup_disable= [KNL] Disable a particular controller cgroup_disable= [KNL] Disable a particular controller
Format: {name of the controller(s) to disable} Format: {name of the controller(s) to disable}
The effects of cgroup_disable=foo are: The effects of cgroup_disable=foo are:
......
...@@ -19,6 +19,9 @@ extern bool numa_off; ...@@ -19,6 +19,9 @@ extern bool numa_off;
extern cpumask_var_t node_to_cpumask_map[MAX_NUMNODES]; extern cpumask_var_t node_to_cpumask_map[MAX_NUMNODES];
void numa_clear_node(unsigned int cpu); void numa_clear_node(unsigned int cpu);
#ifdef CONFIG_COHERENT_DEVICE
extern nodemask_t cdmmask;
#endif
#ifdef CONFIG_DEBUG_PER_CPU_MAPS #ifdef CONFIG_DEBUG_PER_CPU_MAPS
const struct cpumask *cpumask_of_node(int node); const struct cpumask *cpumask_of_node(int node);
#else #else
......
...@@ -26,10 +26,30 @@ static u8 *numa_distance; ...@@ -26,10 +26,30 @@ static u8 *numa_distance;
bool numa_off; bool numa_off;
#ifdef CONFIG_COHERENT_DEVICE #ifdef CONFIG_COHERENT_DEVICE
nodemask_t cdmmask;
inline int arch_check_node_cdm(int nid) inline int arch_check_node_cdm(int nid)
{ {
return node_isset(nid, cdmmask);
}
static int __init cdm_nodes_setup(char *s)
{
int nid;
unsigned long tmpmask;
int err;
err = kstrtoul(s, 0, &tmpmask);
if (err)
return err;
for (nid = 0; nid < MAX_NUMNODES; nid++) {
if ((tmpmask >> nid) & 1)
node_set(nid, cdmmask);
}
return 0; return 0;
} }
early_param("cdm-nodes", cdm_nodes_setup);
#endif #endif
static __init int numa_parse_early_param(char *opt) static __init int numa_parse_early_param(char *opt)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册