From ab1e151e19ed226025d25c897ea8241b582d28c8 Mon Sep 17 00:00:00 2001 From: Kristian Feldsam Date: Sat, 16 Dec 2023 14:26:36 +0100 Subject: [PATCH] F #6185: Support huge pages without CPU pinning Ensure that OpenNebula will: configure the VM with CPU affinity to the auto-selected NUMA node Signed-off-by: Kristian Feldsam --- src/vmm/LibVirtDriverKVM.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vmm/LibVirtDriverKVM.cc b/src/vmm/LibVirtDriverKVM.cc index 3b4671aa08..67dd44c17e 100644 --- a/src/vmm/LibVirtDriverKVM.cc +++ b/src/vmm/LibVirtDriverKVM.cc @@ -170,6 +170,7 @@ static void pin_cpu(ofstream& file, const VectorAttribute * topology, unsigned int vcpu_id = 0; int affinity = -1; + unsigned int hpsz = 0; std::ostringstream oss; @@ -181,9 +182,10 @@ static void pin_cpu(ofstream& file, const VectorAttribute * topology, pp = HostShare::str_to_pin_policy(pp_s); topology->vector_value("NODE_AFFINITY", affinity); + topology->vector_value("HUGEPAGE_SIZE", hpsz); } - if ( pp == HostShare::PP_NONE && affinity == -1) + if ( pp == HostShare::PP_NONE && affinity == -1 && hpsz == 0) { return; }