提交 a24270cc 编写于 作者: S Shijie Luo 提交者: Zheng Zengkai

mm: alloc pages for pmem from peer node

euleros inclusion
category: feature
feature: etmem
bugzilla: 48246

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

Pmem is slower than dram. So alloc pages from pmem's peer
dram node to accelerate access to pmem page struct.
Signed-off-by: NShijie Luo <luoshijie1@huawei.com>
Signed-off-by: Kemeng Shi<shikemeng@huawei.com>
Reviewed-by: louhongxiang <louhongxiang@huawei.com
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 88da6696
......@@ -3056,7 +3056,7 @@ extern int sysctl_memory_failure_recovery;
extern void shake_page(struct page *p, int access);
extern atomic_long_t num_poisoned_pages __read_mostly;
extern int soft_offline_page(unsigned long pfn, int flags);
extern unsigned int sysctl_vmemmap_block_from_dram;
/*
* Error handlers for various types of pages.
......
......@@ -3158,6 +3158,15 @@ static struct ctl_table vm_table[] = {
.extra2 = SYSCTL_ONE,
},
#endif
{
.procname = "vmemmap_block_from_dram",
.data = &sysctl_vmemmap_block_from_dram,
.maxlen = sizeof(sysctl_vmemmap_block_from_dram),
.mode = 0600,
.proc_handler = proc_dointvec_minmax,
.extra1 = SYSCTL_ZERO,
.extra2 = SYSCTL_ONE,
},
{ }
};
......
......@@ -914,6 +914,7 @@ static pg_data_t __ref *hotadd_new_pgdat(int nid)
/* we can use NODE_DATA(nid) from here */
pgdat->node_id = nid;
pgdat->node_start_pfn = 0;
pgdat->peer_node = find_best_peer_node(nid);
/* init node's zones as empty zones, we don't have any present pages.*/
free_area_init_core_hotplug(nid);
......
......@@ -30,6 +30,8 @@
#include <asm/dma.h>
#include <asm/pgalloc.h>
unsigned int sysctl_vmemmap_block_from_dram;
/*
* Allocate a block of memory to be used to back the virtual memory map
* or to back the page tables that are used to create the mapping.
......@@ -54,6 +56,12 @@ void * __meminit vmemmap_alloc_block(unsigned long size, int node)
static bool warned;
struct page *page;
/* if node is pmem node, alloc_pages from it's peer
* dram node to accelerate access to page struct
*/
if (is_node_pmem(node) && sysctl_vmemmap_block_from_dram)
node = NODE_DATA(node)->peer_node;
page = alloc_pages_node(node, gfp_mask, order);
if (page)
return page_address(page);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册