Change in vdsm[master]: scale: limit cpu usage using cpu-affinity
nsoffer at redhat.com
nsoffer at redhat.com
Mon Sep 7 10:54:21 UTC 2015
Nir Soffer has posted comments on this change.
Change subject: scale: limit cpu usage using cpu-affinity
......................................................................
Patch Set 3:
(2 comments)
https://gerrit.ovirt.org/#/c/45738/3/lib/vdsm/cmdutils.py
File lib/vdsm/cmdutils.py:
Line 92: if index < CPU_MIN or index > CPU_MAX:
Line 93: raise ValueError('cpu index %i outside limits [%i, %i]',
Line 94: index, CPU_MIN, CPU_MAX)
Line 95: mask |= (1 << index)
Line 96: return mask
> it is needed the other way around, when we use taskset to get the affinity
When getting cpu list, I think it will be simpler not to use -c/--cpu-list and convert from bits to list of cpus. Something like:
mask = int(mask, 16)
cpus = [i for i in range(mask.bit_length()) if mask & (1 << i)]
Line 97:
Line 98: # This function returns truthy value if its argument contains unsafe characters
Line 99: # for including in a command passed to the shell. The safe characters were
Line 100: # stolen from pipes._safechars.
https://gerrit.ovirt.org/#/c/45738/3/tests/cmdutilsTests.py
File tests/cmdutilsTests.py:
Line 86: self.assertEquals(cmdutils._list2cmdline([]), "")
Line 87:
Line 88:
Line 89: @expandPermutations
Line 90: class CpuMaskTests(VdsmTestCase):
> yep, but we'll need something similar for the range syntax (see comments in
See my reply in cmdutils.py
Line 91:
Line 92: @permutations([
Line 93: ['a'],
Line 94: ['1,a'],
--
To view, visit https://gerrit.ovirt.org/45738
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I3f7f68d65eddb5a21afbc3809ea79cd1dee67984
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Adam Litke <alitke 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: Martin Sivák <msivak at redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek at redhat.com>
Gerrit-Reviewer: Michal Skrivanek <mskrivan 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: automation at ovirt.org
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list