Change in vdsm[master]: lib: daemon: cpu affinity support using taskset

mpolednik at redhat.com mpolednik at redhat.com
Fri Sep 4 11:01:00 UTC 2015


Martin Polednik has posted comments on this change.

Change subject: lib: daemon: cpu affinity support using taskset
......................................................................


Patch Set 1:

(3 comments)

https://gerrit.ovirt.org/#/c/45738/1/lib/vdsm/utils.py
File lib/vdsm/utils.py:

Line 1295:             yield int(item)
Line 1296: 
Line 1297: 
Line 1298: def cpu_mask_to_bits(cpus):
Line 1299:     mask = 0
> move below at the beginning of the for loop (this isn't C :) )
to be a bit less C-ish, 'index' sounds nicer ;) (applies also for above)
Line 1300:     if not cpus:
Line 1301:         return CPU_ANY
Line 1302: 
Line 1303:     for idx in _expand_cpu_list(cpus):


Line 1300:     if not cpus:
Line 1301:         return CPU_ANY
Line 1302: 
Line 1303:     for idx in _expand_cpu_list(cpus):
Line 1304:         mask = _enable_cpu(mask, idx)
This feels hard to read to me - what about returning only the shift and doing mask |= _enable_cpu_{shift, mask, ??}(mask, index) ?


https://gerrit.ovirt.org/#/c/45738/1/tests/utilsTests.py
File tests/utilsTests.py:

Line 963:                   ['0,-'],
Line 964:                   ['-3'],
Line 965:                   ['4-'],
Line 966:                   [','],
Line 967:                   [',,']
add '-' as a test case (for peace of mind ;) )
Line 968:                   ])
Line 969:     def test_invalid_input(self, cpus):
Line 970:         self.assertRaises(ValueError,
Line 971:                           utils.cpu_mask_to_bits,


-- 
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: 1
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