Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: Add memtune hard_limit for q35 VMs with many CPUs #382

Merged
merged 1 commit into from
May 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ public String buildCreateVm() {
}
writeCpu(numaEnabled || vm.isHostedEngine() && !vmNumaNodesSupplier.get().isEmpty());
writeCpuTune();
writeMemtune();
writeQemuCapabilities();
writeDevices();
writePowerManagement();
Expand Down Expand Up @@ -1564,6 +1565,17 @@ private void writeIommu() {
}
}

private void writeMemtune() {
if (VmInfoBuildUtils.needsMemtune(vm)) {
writer.writeStartElement("memtune");
writer.writeStartElement("hard_limit");
writer.writeAttributeString("unit", "TiB");
writer.writeRaw("1024");
writer.writeEndElement();
writer.writeEndElement();
}
}

private void writeSpiceVmcChannel() {
writer.writeStartElement("channel");
writer.writeAttributeString("type", "spicevmc");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1740,4 +1740,9 @@ public String getVdsmCpuPinningPolicy(VM vm) {
}
return cpuPinningPolicyName;
}

public static boolean needsMemtune(VM vm) {
ahadas marked this conversation as resolved.
Show resolved Hide resolved
return vm.getBiosType() != null && vm.getBiosType().getChipsetType() == ChipsetType.Q35
ahadas marked this conversation as resolved.
Show resolved Hide resolved
&& maxNumberOfVcpus(vm) >= 256;
}
}