Commit a9850de3 authored by Lijun Fang's avatar Lijun Fang Committed by Zheng Zengkai
Browse files

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: default avatarLijun Fang <fanglijun3@huawei.com>
Reviewed-by: default avatarWeilong Chen <chenweilong@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent c80f1cb2
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -493,6 +493,12 @@
	ccw_timeout_log	[S390]
			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
			Format: {name of the controller(s) to disable}
			The effects of cgroup_disable=foo are:
+3 −0
Original line number Diff line number Diff line
@@ -19,6 +19,9 @@ extern bool numa_off;
extern cpumask_var_t node_to_cpumask_map[MAX_NUMNODES];
void numa_clear_node(unsigned int cpu);

#ifdef CONFIG_COHERENT_DEVICE
extern nodemask_t cdmmask;
#endif
#ifdef CONFIG_DEBUG_PER_CPU_MAPS
const struct cpumask *cpumask_of_node(int node);
#else
+20 −0
Original line number Diff line number Diff line
@@ -26,10 +26,30 @@ static u8 *numa_distance;
bool numa_off;

#ifdef CONFIG_COHERENT_DEVICE
nodemask_t cdmmask;

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;
}
early_param("cdm-nodes", cdm_nodes_setup);
#endif

static __init int numa_parse_early_param(char *opt)