Change in vdsm[master]: daemon: autodisable cpu affinity on singlecore
nsoffer at redhat.com
nsoffer at redhat.com
Thu Nov 19 18:35:24 UTC 2015
Nir Soffer has posted comments on this change.
Change subject: daemon: autodisable cpu affinity on singlecore
......................................................................
Patch Set 4: Code-Review-1
(4 comments)
https://gerrit.ovirt.org/#/c/48619/4//COMMIT_MSG
Commit Message:
Line 3: AuthorDate: 2015-11-16 14:42:54 +0100
Line 4: Commit: Francesco Romani <fromani at redhat.com>
Line 5: CommitDate: 2015-11-17 13:16:19 +0100
Line 6:
Line 7: daemon: autodisable cpu affinity on singlecore
Lets use the term processor, one core can have multiple processors.
Line 8:
Line 9: If VDSM runs on single-core hosts (E.g. VMs, QE boxes)
Line 10: there is no point in enabling cpu affinity, since
Line 11: we already reached the goal of running on just one CPU.
Line 5: CommitDate: 2015-11-17 13:16:19 +0100
Line 6:
Line 7: daemon: autodisable cpu affinity on singlecore
Line 8:
Line 9: If VDSM runs on single-core hosts (E.g. VMs, QE boxes)
QE boxes are vms usually.
Line 10: there is no point in enabling cpu affinity, since
Line 11: we already reached the goal of running on just one CPU.
Line 12:
Line 13: Change-Id: I0652189704cbce71d20ec809c9c26f081516758a
https://gerrit.ovirt.org/#/c/48619/4/vdsm/vdsm
File vdsm/vdsm:
Line 229: log.info('VDSM will run with cpu affinity: %s', cpu_set)
Line 230:
Line 231: # too early to use the facilities from caps.py
Line 232: if os.sysconf('SC_NPROCESSORS_ONLN') == 1:
Line 233: log.warning('Only one cpu detected: affinity disabled')
This is correct for this case (run on second processor, having only one processor). What about other configurations, like run on cpu 4, having only 4 processors (0,1,2,3)?
I think this is good enough for now, to unbreak the tests, but we should come up with better error handling.
Line 234: else:
Line 235: taskset.set(os.getpid(), cpu_set, all_tasks=True)
Line 236:
Line 237:
Line 231: # too early to use the facilities from caps.py
Line 232: if os.sysconf('SC_NPROCESSORS_ONLN') == 1:
Line 233: log.warning('Only one cpu detected: affinity disabled')
Line 234: else:
Line 235: taskset.set(os.getpid(), cpu_set, all_tasks=True)
Please keep the early return style.
Line 236:
Line 237:
Line 238: def main():
Line 239: __assertVdsmUser()
--
To view, visit https://gerrit.ovirt.org/48619
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I0652189704cbce71d20ec809c9c26f081516758a
Gerrit-PatchSet: 4
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: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Petr Horáček <phoracek at redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list