Francesco Romani has posted comments on this change. Change subject: Cache the result of numaUtils.getVcpuPids ......................................................................
Patch Set 3: Code-Review-1 (3 comments) I'm fine with the concept, but please check inside comments - probable bug inside, hence -1. Moreover, please check my question on patchset #1 https://gerrit.ovirt.org/#/c/38564/3/vdsm/numaUtils.py File vdsm/numaUtils.py: Line 26: import caps Line 27: import supervdsm Line 28: Line 29: # xml file name -> (last mtime, cached value) Line 30: _libvirt_vcpu_pids_cache = {} invalidateNumaCache _can_ be called asynchronously... Line 31: Line 32: Line 33: def _libvirt_xml_path(vmName): Line 34: return "/var/run/libvirt/qemu/%s.xml" % vmName Line 34: return "/var/run/libvirt/qemu/%s.xml" % vmName Line 35: Line 36: Line 37: def invalidateNumaCache(vm): Line 38: vmName = vm['vmName'].encode('utf-8') either vm.conf['vmName'] or vm.name Line 39: path = _libvirt_xml_path(vmName) Line 40: try: Line 41: del _libvirt_vcpu_pids_cache[path] Line 42: except KeyError: Line 47: path = _libvirt_xml_path(vmName) Line 48: mtime = os.path.getmtime(path) Line 49: Line 50: if path in _libvirt_vcpu_pids_cache: Line 51: lastmtime, value = _libvirt_vcpu_pids_cache[path] ...so this raise some suspects Line 52: if lastmtime == mtime: Line 53: return value Line 54: Line 55: runInfo = ET.parse(path) -- To view, visit https://gerrit.ovirt.org/38564 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I135143bccdd29697ec673819212193c0fc217e56 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Sivák <[email protected]> Gerrit-Reviewer: Dan Kenigsberg <[email protected]> Gerrit-Reviewer: Francesco Romani <[email protected]> Gerrit-Reviewer: Gilad Chaplik <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
