mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-04 16:38:16 +00:00
fix #2570: add 'keephugepages' config
We already keep hugepages if they are created with the kernel commandline (hugepagesz=x hugepages=y), but some setups (specifically hugepages across multiple NUMA nodes) cannot be configured that way. Since we always clear these hugepages at VM shutdown, rebooting a VM that uses them might not work, since the requested count might not be available anymore by the time we want to use them (also, we would then no longer allocate them correctly on the NUMA nodes). Add a 'keephugepages' parameter to skip cleanup and simply leave them untouched. Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
This commit is contained in:
parent
116df99cc6
commit
f36e9894ff
@ -441,6 +441,14 @@ EODESC
|
|||||||
description => "Enable/disable hugepages memory.",
|
description => "Enable/disable hugepages memory.",
|
||||||
enum => [qw(any 2 1024)],
|
enum => [qw(any 2 1024)],
|
||||||
},
|
},
|
||||||
|
keephugepages => {
|
||||||
|
optional => 1,
|
||||||
|
type => 'boolean',
|
||||||
|
default => 0,
|
||||||
|
description => "Use together with hugepages. If enabled, hugepages will"
|
||||||
|
. " not be deleted after VM shutdown and can be used for"
|
||||||
|
. " subsequent starts.",
|
||||||
|
},
|
||||||
vcpus => {
|
vcpus => {
|
||||||
optional => 1,
|
optional => 1,
|
||||||
type => 'integer',
|
type => 'integer',
|
||||||
@ -5034,11 +5042,13 @@ sub vm_start_nolock {
|
|||||||
|
|
||||||
eval { $run_qemu->() };
|
eval { $run_qemu->() };
|
||||||
if (my $err = $@) {
|
if (my $err = $@) {
|
||||||
PVE::QemuServer::Memory::hugepages_reset($hugepages_host_topology);
|
PVE::QemuServer::Memory::hugepages_reset($hugepages_host_topology)
|
||||||
|
if !$conf->{keephugepages};
|
||||||
die $err;
|
die $err;
|
||||||
}
|
}
|
||||||
|
|
||||||
PVE::QemuServer::Memory::hugepages_pre_deallocate($hugepages_topology);
|
PVE::QemuServer::Memory::hugepages_pre_deallocate($hugepages_topology)
|
||||||
|
if !$conf->{keephugepages};
|
||||||
};
|
};
|
||||||
eval { PVE::QemuServer::Memory::hugepages_update_locked($code); };
|
eval { PVE::QemuServer::Memory::hugepages_update_locked($code); };
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user