Change in vdsm[master]: lib: taskset: commands should run on all cpus

fromani at redhat.com fromani at redhat.com
Wed Oct 28 08:24:31 UTC 2015


Francesco Romani has uploaded a new change for review.

Change subject: lib: taskset: commands should run on all cpus
......................................................................

lib: taskset: commands should run on all cpus

The current affinity reset logic has a bug in the
case the sysadmin puts offline one or more cpu.
This is because we use the range notation, with
the upper limit given by sysconf('SC_NPROCESSORS_ONLN')-1

Let's say we have 16 cpus, and sysadmin puts offline
cpu #11. Now we will have 15 online cpus, so we'll
build our range as 0-14, which excludes the perfectly
fine cpu #15.
Note that the range still includes the offline CPU, but
it is safe to trust the kernel NOT to use it.
However, this buggy logic make VDSM rule out TWO cpus,
one implicitely (included in range, but offline), plus
the one erroneously excluded by the range.

To fix this, we simply always use SC_NPROCESSORS_CONF
to express the maximum physical range, and we let the
kernel handle the holes on this range.

Change-Id: I0d17ab063356bcfde1192d545a7d41114eeab0be
Signed-off-by: Francesco Romani <fromani at redhat.com>
---
M lib/vdsm/cmdutils.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/01/47801/1

diff --git a/lib/vdsm/cmdutils.py b/lib/vdsm/cmdutils.py
index 74ce79f..445aa80 100644
--- a/lib/vdsm/cmdutils.py
+++ b/lib/vdsm/cmdutils.py
@@ -74,7 +74,7 @@
     return command
 
 
-_ANY_CPU = ["0-%d" % (os.sysconf('SC_NPROCESSORS_ONLN') - 1)]
+_ANY_CPU = ["0-%d" % (os.sysconf('SC_NPROCESSORS_CONF') - 1)]
 _USING_CPU_AFFINITY = config.get('vars', 'cpu_affinity') != ""
 
 


-- 
To view, visit https://gerrit.ovirt.org/47801
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0d17ab063356bcfde1192d545a7d41114eeab0be
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>


More information about the vdsm-patches mailing list