Skip to content

Commit

Permalink
F OpenNebula#6185: Support huge pages without CPU pinning
Browse files Browse the repository at this point in the history
Ensure that OpenNebula will: configure the VM with CPU affinity to the auto-selected NUMA node

Signed-off-by: Kristian Feldsam <[email protected]>
  • Loading branch information
feldsam committed Dec 16, 2023
1 parent 725337e commit c6adde2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/vmm/LibVirtDriverKVM.cc
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ static void pin_cpu(ofstream& file, std::string& emulator_cpus,

unsigned int vcpu_id = 0;
int affinity = -1;
unsigned int hpsz = 0;

std::ostringstream oss;

Expand All @@ -185,9 +186,10 @@ static void pin_cpu(ofstream& file, std::string& emulator_cpus,
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)
{
if (!emulator_cpus.empty())
{
Expand Down

0 comments on commit c6adde2

Please sign in to comment.