Commit f733e6e6 authored by Ondřej Lysoněk's avatar Ondřej Lysoněk

scheduler: isolated_cores: Fix checking CPUs are valid

Fix checking that the list of CPUs specified in isolated_cores
contains only CPUs that are present on the machine.
Signed-off-by: default avatarOndřej Lysoněk <olysonek@redhat.com>
parent 91c89db3
......@@ -612,12 +612,13 @@ class SchedulerPlugin(base.Plugin):
return None
if enabling:
if value is not None:
affinity = self._cmd.cpulist_invert(value)
sa = set(affinity)
if set(self._cpus).intersection(sa) != sa:
isolated = set(self._cmd.cpulist_unpack(value))
present = set(self._cpus)
if not isolated.issubset(present):
str_cpus = ",".join([str(x) for x in self._cpus])
log.error("invalid isolated_cores specified, '%s' don't match available cores '%s'" % (value, str_cpus))
return None
affinity = list(present - isolated)
self._set_ps_affinity(affinity)
self._set_all_irq_affinity(affinity)
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment