Change in vdsm[ovirt-3.6]: daemon: ignore cpu affinity on single processor

fromani at redhat.com fromani at redhat.com
Mon Nov 23 07:57:30 UTC 2015


Francesco Romani has uploaded a new change for review.

Change subject: daemon: ignore cpu affinity on single processor
......................................................................

daemon: ignore cpu affinity on single processor

If VDSM runs on single processor hosts (E.g. VMs)
there is no point in enabling cpu affinity, since
we already reached the goal of running on just one CPU.

Change-Id: I0652189704cbce71d20ec809c9c26f081516758a
Bug-Url: https://bugzilla.redhat.com/1279431
Backport-To: 3.6
Signed-off-by: Francesco Romani <fromani at redhat.com>
Reviewed-on: https://gerrit.ovirt.org/48619
Continuous-Integration: Jenkins CI
Reviewed-by: Nir Soffer <nsoffer at redhat.com>
---
M vdsm/vdsm
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/61/48961/1

diff --git a/vdsm/vdsm b/vdsm/vdsm
index 867e900..c9b6219 100755
--- a/vdsm/vdsm
+++ b/vdsm/vdsm
@@ -271,6 +271,11 @@
         log = logging.getLogger('vds')
         log.info('VDSM will run with cpu affinity: %s', cpu_set)
 
+        # too early to use the facilities from caps.py
+        if os.sysconf('SC_NPROCESSORS_ONLN') == 1:
+            log.warning('Only one cpu detected: affinity disabled')
+            return
+
         taskset.set(os.getpid(), cpu_set, all_tasks=True)
 
 


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

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


More information about the vdsm-patches mailing list