Dan Kenigsberg has posted comments on this change.

Change subject: Online check ksmState and ksmPages.
......................................................................


Patch Set 1: I would prefer that you didn't submit this

(3 inline comments)

it seems that this patch include more changes than the ones required to report 
the up-to-date state of ksm.

....................................................
File vdsm/API.py
Line 1371:         Return an approximation of memory shared by VMs thanks to 
KSM.
Line 1372:         """
Line 1373:         return (self._cif.ksmMonitor.memsharing() * PAGE_SIZE_BYTES)
Line 1374: 
Line 1375:     def _ksmState(self):
the API object is too big as it is. adding ksm-specific functionality to it is 
not good modeling.
Line 1376:         """
Line 1377:         Return ksm running state.
Line 1378:         """
Line 1379:         return (self._cif.ksmMonitor.running())


....................................................
File vdsm/ksm.py
Line 86:             return 
(int(file('/sys/kernel/mm/ksm/pages_sharing').read()))
Line 87:         except:
Line 88:             return 0
Line 89: 
Line 90:     def running(self):
why is it helpful to make these object methods? I do not see they are using 
self.
Line 91:         try:
Line 92:             return (int(file('/sys/kernel/mm/ksm/run').read()) & 1 == 
1)
Line 93:         except:
Line 94:             return False


Line 88:             return 0
Line 89: 
Line 90:     def running(self):
Line 91:         try:
Line 92:             return (int(file('/sys/kernel/mm/ksm/run').read()) & 1 == 
1)
this is not C, so what is the benefit in the added parenthesis?
Line 93:         except:
Line 94:             return False
Line 95: 
Line 96:     def npages(self):


--
To view, visit http://gerrit.ovirt.org/9510
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I84c2f8b80529a47662bdeac80bb3f71defd0758a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Amador Pahim <[email protected]>
Gerrit-Reviewer: Amador Pahim <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Doron Fediuck <[email protected]>
Gerrit-Reviewer: Douglas Schilling Landgraf <[email protected]>
Gerrit-Reviewer: Laszlo Hornyak <[email protected]>
Gerrit-Reviewer: Royce Lv <[email protected]>
Gerrit-Reviewer: Xu He Jie <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to