From a8054e5aaec4a563bd64be00ceaa4e52eefb0bd0 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Thu, 22 Jan 2015 12:38:22 +0200 Subject: [PATCH] memory: init virt to phys mapping after binding memory to node Binding may cause memory to move, so initialize the page map after it is done. --- core/memory.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/memory.cc b/core/memory.cc index 3b1639ea49..9b6a16558d 100644 --- a/core/memory.cc +++ b/core/memory.cc @@ -837,9 +837,6 @@ void configure(std::vector m, cpu_mem.replace_memory_backing(sys_alloc); } cpu_mem.resize(total, sys_alloc); - if (hugetlbfs_path) { - cpu_mem.init_virt_to_phys_map(); - } size_t pos = 0; for (auto&& x : m) { #ifdef HAVE_NUMA @@ -852,6 +849,9 @@ void configure(std::vector m, #endif pos += x.bytes; } + if (hugetlbfs_path) { + cpu_mem.init_virt_to_phys_map(); + } } statistics stats() {