mem_init(): parse NUMA information
This commit is contained in:
26
kernel/mem.c
26
kernel/mem.c
@@ -451,6 +451,31 @@ static void page_allocator_init(void)
|
|||||||
&query_free_mem_handler);
|
&query_free_mem_handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void numa_init(void)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < ihk_mc_get_nr_numa_nodes(); ++i) {
|
||||||
|
int linux_numa_id, type;
|
||||||
|
|
||||||
|
ihk_mc_get_numa_node(i, &linux_numa_id, &type);
|
||||||
|
|
||||||
|
kprintf("NUMA %d, Linux NUMA id: %d, type: %d\n",
|
||||||
|
i, linux_numa_id, type);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < ihk_mc_get_nr_memory_chunks(); ++i) {
|
||||||
|
unsigned long start, end;
|
||||||
|
int linux_numa_id;
|
||||||
|
|
||||||
|
ihk_mc_get_memory_chunk(i, &start, &end, &linux_numa_id);
|
||||||
|
|
||||||
|
kprintf("Physical memory region: %p - %p @ Linux NUMA id: %d\n",
|
||||||
|
start, end, linux_numa_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
struct page *phys_to_page(uintptr_t phys)
|
struct page *phys_to_page(uintptr_t phys)
|
||||||
{
|
{
|
||||||
int64_t ix;
|
int64_t ix;
|
||||||
@@ -641,6 +666,7 @@ void ihk_mc_clean_micpa(void){
|
|||||||
|
|
||||||
void mem_init(void)
|
void mem_init(void)
|
||||||
{
|
{
|
||||||
|
numa_init();
|
||||||
page_allocator_init();
|
page_allocator_init();
|
||||||
page_init();
|
page_init();
|
||||||
|
|
||||||
|
|||||||
@@ -151,6 +151,14 @@ int ihk_mc_pt_virt_to_phys(struct page_table *pt,
|
|||||||
const void *virt, unsigned long *phys);
|
const void *virt, unsigned long *phys);
|
||||||
uint64_t ihk_mc_pt_virt_to_pagemap(struct page_table *pt, unsigned long virt);
|
uint64_t ihk_mc_pt_virt_to_pagemap(struct page_table *pt, unsigned long virt);
|
||||||
|
|
||||||
|
int ihk_mc_get_nr_numa_nodes(void);
|
||||||
|
int ihk_mc_get_numa_node(int id, int *linux_numa_id, int *type);
|
||||||
|
int ihk_mc_get_nr_memory_chunks(void);
|
||||||
|
int ihk_mc_get_memory_chunk(int id,
|
||||||
|
unsigned long *start,
|
||||||
|
unsigned long *end,
|
||||||
|
int *linux_numa_id);
|
||||||
|
|
||||||
void remote_flush_tlb_cpumask(struct process_vm *vm,
|
void remote_flush_tlb_cpumask(struct process_vm *vm,
|
||||||
unsigned long addr, int cpu_id);
|
unsigned long addr, int cpu_id);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user