Change in vdsm[master]: lib: daemon: autodetect online cpus for affinity

danken at redhat.com danken at redhat.com
Thu Dec 3 07:06:19 UTC 2015


Dan Kenigsberg has submitted this change and it was merged.

Change subject: lib: daemon: autodetect online cpus for affinity
......................................................................


lib: daemon: autodetect online cpus for affinity

In commit a1d4e23 we enabled by default the cpu affinity
for VDSM, after we had confirmation this delivered important
performance benefits.

An hardcoded default setting for any cpu core is a too naive
approach, as it could break automated setups if the said CPU
is offline. And Vdsm cannot guess that.

To solve this, we add a function to learn from the kernel which
cpus are online, using a file from /sys pseudo-filesystem.
This is a simplified version of the same approach libvirt uses.
We don't leverage libvirt because it is too early in the
VDSM startup.

The layout of /sys, like /proc, is part of the kernel ABI,
so there are only small breakage concerns [1][2].
Furthermore, we already rely on /sys for other VDSM flows,
so this patch doesn't add fragility

We add a special value to the cpu_affinity tunable, to let
Vdsm select automatically best cpu. We choose the second
online core in the system, handling the case on which
only one core is active.

The admin can still select explicitely the cores on which
Vdsm should pin to, or still can disable the pinning entirely.

[1] https://www.kernel.org/doc/Documentation/ABI/README
[2] https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-devices-system-cpu

Change-Id: Iba834f67a43ce766308036cbd079107340ed69d8
Bug-Url: https://bugzilla.redhat.com/1286462
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/49402
Reviewed-by: Nir Soffer <nsoffer at redhat.com>
Continuous-Integration: Jenkins CI
Reviewed-by: Piotr Kliczewski <piotr.kliczewski at gmail.com>
---
M lib/vdsm/config.py.in
M lib/vdsm/taskset.py
M tests/tasksetTests.py
M vdsm/vdsm
4 files changed, 100 insertions(+), 11 deletions(-)

Approvals:
  Piotr Kliczewski: Looks good to me, but someone else must approve
  Nir Soffer: Looks good to me, approved
  Jenkins CI: Passed CI tests
  Francesco Romani: Verified



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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iba834f67a43ce766308036cbd079107340ed69d8
Gerrit-PatchSet: 12
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik <mpolednik at redhat.com>
Gerrit-Reviewer: Michal Skrivanek <mskrivan at redhat.com>
Gerrit-Reviewer: Milan Zamazal <mzamazal at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>


More information about the vdsm-patches mailing list