qemu: Allow more generous cpuset.mems for vCPUs and IOThreads

The unit that cpuset CGroups controller works with is a
thread/process, not individual memory allocations. Therefore,
after we've set cpuset.mems for emulator (after previous commit
it's set to union of all host NUMA nodes allowed for given
domain), and as we try to set up cpuset.mems for vCPUs/IOThreads,
memory is migrated to selected NUMA node(s). We are effectively
saying: "this thread (vCPU thread) can have memory only from
these NUMA node(s)".

That's not really what we want though. The cpuset controller
doesn't differentiate memory "belonging" to the emulator thread
and vCPU thread or IOThread even.

Therefore, set union of all allowed host NUMA nodes, just like
we're doing for the emulator thread.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2138150
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Michal Privoznik 2023-06-07 08:40:15 +02:00
parent fddbb2f12f
commit 83adba541a

View File

@ -2598,7 +2598,6 @@ qemuProcessSetupPid(virDomainObj *vm,
/* QEMU allocates its memory from the emulator thread. Thus it
* needs to access union of all host nodes configured. */
if (unionMems &&
nameval == VIR_CGROUP_THREAD_EMULATOR &&
mem_mode != VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE) {
qemuDomainNumatuneMaybeFormatNodesetUnion(vm, NULL, &mem_mask);
} else {
@ -5911,7 +5910,7 @@ qemuProcessSetupVcpu(virDomainObj *vm,
vm->def->cputune.period,
vm->def->cputune.quota,
&vcpu->sched,
false) < 0)
true) < 0)
return -1;
if (schedCore &&
@ -6067,7 +6066,7 @@ qemuProcessSetupIOThread(virDomainObj *vm,
vm->def->cputune.iothread_period,
vm->def->cputune.iothread_quota,
&iothread->sched,
false);
true);
}