mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 23:07:44 +00:00
qemu: leave restricting cpuset.mems after initialization
When domain is started with numatune memory mode strict and the nodeset does not include host NUMA node with DMA and DMA32 zones, KVM initialization fails. This is because cgroup restrict even kernel allocations. We are already doing numa_set_membind() which does the same thing, only it does not restrict kernel allocations. This patch leaves the userspace numa_set_membind() in place and moves the cpuset.mems setting after the point where monitor comes up, but before vcpu and emulator sub-groups are created. Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
aa668fccf0
commit
7e72ac7878
@ -627,9 +627,6 @@ qemuSetupCpusetCgroup(virDomainObjPtr vm,
|
|||||||
if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPUSET))
|
if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPUSET))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (qemuSetupCpusetMems(vm, nodemask) < 0)
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
if (vm->def->cpumask ||
|
if (vm->def->cpumask ||
|
||||||
(vm->def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO)) {
|
(vm->def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO)) {
|
||||||
|
|
||||||
@ -825,6 +822,13 @@ qemuSetupCgroup(virQEMUDriverPtr driver,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
qemuSetupCgroupPostInit(virDomainObjPtr vm,
|
||||||
|
virBitmapPtr nodemask)
|
||||||
|
{
|
||||||
|
return qemuSetupCpusetMems(vm, nodemask);
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
qemuSetupCgroupVcpuBW(virCgroupPtr cgroup,
|
qemuSetupCgroupVcpuBW(virCgroupPtr cgroup,
|
||||||
unsigned long long period,
|
unsigned long long period,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* qemu_cgroup.h: QEMU cgroup management
|
* qemu_cgroup.h: QEMU cgroup management
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2007, 2009-2013 Red Hat, Inc.
|
* Copyright (C) 2006-2007, 2009-2014 Red Hat, Inc.
|
||||||
* Copyright (C) 2006 Daniel P. Berrange
|
* Copyright (C) 2006 Daniel P. Berrange
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
@ -47,6 +47,8 @@ int qemuConnectCgroup(virQEMUDriverPtr driver,
|
|||||||
int qemuSetupCgroup(virQEMUDriverPtr driver,
|
int qemuSetupCgroup(virQEMUDriverPtr driver,
|
||||||
virDomainObjPtr vm,
|
virDomainObjPtr vm,
|
||||||
virBitmapPtr nodemask);
|
virBitmapPtr nodemask);
|
||||||
|
int qemuSetupCgroupPostInit(virDomainObjPtr vm,
|
||||||
|
virBitmapPtr nodemask);
|
||||||
int qemuSetupCgroupVcpuBW(virCgroupPtr cgroup,
|
int qemuSetupCgroupVcpuBW(virCgroupPtr cgroup,
|
||||||
unsigned long long period,
|
unsigned long long period,
|
||||||
long long quota);
|
long long quota);
|
||||||
|
@ -4155,6 +4155,10 @@ int qemuProcessStart(virConnectPtr conn,
|
|||||||
if (!qemuProcessVerifyGuestCPU(driver, vm))
|
if (!qemuProcessVerifyGuestCPU(driver, vm))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
VIR_DEBUG("Setting up post-init cgroup restrictions");
|
||||||
|
if (qemuSetupCgroupPostInit(vm, nodemask) < 0)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
VIR_DEBUG("Detecting VCPU PIDs");
|
VIR_DEBUG("Detecting VCPU PIDs");
|
||||||
if (qemuProcessDetectVcpuPIDs(driver, vm) < 0)
|
if (qemuProcessDetectVcpuPIDs(driver, vm) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
Loading…
Reference in New Issue
Block a user