virBitmapPtr nodeset = NULL;
virDomainNumatuneMemMode mode;
- VIR_DEBUG("Setting up process resource limits");
+ mode = virDomainNumatuneGetMode(ctrl->def->numa, -1);
- if (virLXCControllerGetNumadAdvice(ctrl, &auto_nodeset) < 0)
- goto cleanup;
+ if (mode == VIR_DOMAIN_NUMATUNE_MEM_STRICT &&
+ virCgroupControllerAvailable(VIR_CGROUP_CONTROLLER_CPUSET)) {
+ /* Use virNuma* API iff necessary. Once set and child is exec()-ed,
+ * there's no way for us to change it. Rely on cgroups (if available
+ * and enabled in the config) rather then virNuma*. */
+ VIR_DEBUG("Relying on CGroups for memory binding");
+ } else {
- nodeset = virDomainNumatuneGetNodeset(ctrl->def->numa, auto_nodeset, -1);
- mode = virDomainNumatuneGetMode(ctrl->def->numa, -1);
+ VIR_DEBUG("Setting up process resource limits");
- if (virNumaSetupMemoryPolicy(mode, nodeset) < 0)
- goto cleanup;
+ if (virLXCControllerGetNumadAdvice(ctrl, &auto_nodeset) < 0)
+ goto cleanup;
+
+ nodeset = virDomainNumatuneGetNodeset(ctrl->def->numa, auto_nodeset, -1);
+
+ if (virNumaSetupMemoryPolicy(mode, nodeset) < 0)
+ goto cleanup;
+ }
if (virLXCControllerSetupCpuAffinity(ctrl) < 0)
goto cleanup;