提交 1c76b8cf 编写于 作者: K Kemeng Shi 提交者: Zheng Zengkai

acpi/numa: memorize node type from SRAT table

euleros inclusion
category: feature
feature: etmem
bugzilla: https://gitee.com/openeuler/kernel/issues/I4OODH?from=project-issue
CVE: NA

-------------------------------------------------

Driver dax_kmem will export pmem as a NUMA node. This patch will
record node consists of persistent memory for futher use.
Signed-off-by: NKemeng Shi <shikemeng@huawei.com>
Reviewed-by: Nlouhongxiang <louhongxiang@huawei.com>
Reviewed-by: NKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 62620120
......@@ -279,6 +279,11 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma)
node_set(node, numa_nodes_parsed);
if (ma->flags & ACPI_SRAT_MEM_NON_VOLATILE)
set_node_type(node, NODE_TYPE_PMEM);
else
set_node_type(node, NODE_TYPE_DRAM);
pr_info("SRAT: Node %u PXM %u [mem %#010Lx-%#010Lx]%s%s\n",
node, pxm,
(unsigned long long) start, (unsigned long long) end - 1,
......
......@@ -20,6 +20,11 @@
#define __initdata_or_meminfo __initdata
#endif
enum node_type {
NODE_TYPE_DRAM,
NODE_TYPE_PMEM,
};
#ifdef CONFIG_NUMA
#include <linux/printk.h>
#include <asm/sparsemem.h>
......@@ -43,6 +48,8 @@ static inline int phys_to_target_node(u64 start)
return 0;
}
#endif
void set_node_type(int nid, enum node_type type);
enum node_type get_node_type(int nid);
#else /* !CONFIG_NUMA */
static inline int numa_map_to_online_node(int node)
{
......@@ -56,6 +63,11 @@ static inline int phys_to_target_node(u64 start)
{
return 0;
}
static inline enum node_type get_node_type(int nid)
{
return NODE_TYPE_DRAM;
}
static inline void set_node_type(int nid, enum node_type type) {}
#endif
#endif /* _LINUX_NUMA_H */
......@@ -9158,3 +9158,16 @@ bool take_page_off_buddy(struct page *page)
return ret;
}
#endif
#ifdef CONFIG_NUMA
enum node_type nodes_type[MAX_NUMNODES];
void set_node_type(int nid, enum node_type type)
{
nodes_type[nid] = type;
}
enum node_type get_node_type(int nid)
{
return nodes_type[nid];
}
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册