Laszlo Hornyak has posted comments on this change.
Change subject: start ksm and ksmtuned when vdsm starts
......................................................................
Patch Set 1: (7 inline comments)
....................................................
File vdsm/ksm.py
Line 36: pids = utils.execCmd([constants.EXT_PGREP, '-xf', 'ksmd'],
Line 37: raw=False, sudo=False)[1]
Line 38: if pids:
Line 39: self._pid = pids[0].strip()
Line 40: self._cif.log.info('starting ksm monitor thread, ksm
pid is %s', self._pid)
strangely, it passed the compilation. is there a fubar with pep8?
Line 41: self.start()
Line 42: else:
Line 43: self._cif.log.error('failed to find ksmd thread')
Line 44: else:
Line 62: os.sysconf('SC_CLK_TCK') /
KSM_MONITOR_INTERVAL
Line 63: jiff0 = jiff1
Line 64: except:
Line 65: self._cif.log.error("Error monitoring KSM", exc_info=True)
Line 66: ksm_stop()
Ok
Line 67:
Line 68: def readState(self):
Line 69: return ksm_running(), npages()
Line 70:
Line 94: return False
Line 95:
Line 96: def ksmtuned_running():
Line 97: try:
Line 98: logging.debug('checking ksmtuned')
Done
Line 99: ret = utils.execCmd([constants.EXT_SERVICE, 'ksmtuned',
'status'], sudo=True)[1][0]
Line 100: logging.info('ksmtuned: %s', ret)
Line 101: return ret != "ksmtuned is stopped"
Line 102: except:
Line 95:
Line 96: def ksmtuned_running():
Line 97: try:
Line 98: logging.debug('checking ksmtuned')
Line 99: ret = utils.execCmd([constants.EXT_SERVICE, 'ksmtuned',
'status'], sudo=True)[1][0]
Done
Line 100: logging.info('ksmtuned: %s', ret)
Line 101: return ret != "ksmtuned is stopped"
Line 102: except:
Line 103: return False
Line 98: logging.debug('checking ksmtuned')
Line 99: ret = utils.execCmd([constants.EXT_SERVICE, 'ksmtuned',
'status'], sudo=True)[1][0]
Line 100: logging.info('ksmtuned: %s', ret)
Line 101: return ret != "ksmtuned is stopped"
Line 102: except:
What do you want to see here?
Line 103: return False
Line 104:
Line 105: def npages():
Line 106: try:
Line 108: return npages
Line 109: except:
Line 110: return 0
Line 111:
Line 112: def ksm_start():
since ksm and ksmtuned are two different services
Line 113: if not ksmtuned_running():
Line 114: utils.execCmd([constants.EXT_SERVICE, 'ksmtuned', 'start'],
sudo=True)
Line 115: if not ksm_running():
Line 116: utils.execCmd([constants.EXT_SERVICE, 'ksm', 'start'],
sudo=True)
Line 115: if not ksm_running():
Line 116: utils.execCmd([constants.EXT_SERVICE, 'ksm', 'start'],
sudo=True)
Line 117:
Line 118: def ksm_stop():
Line 119: if ksmtuned_running():
So what you want is to try start even if it is running already?
Line 120: utils.execCmd([constants.EXT_SERVICE, 'ksmtuned', 'stop'],
sudo=True)
Line 121: if ksm_running():
Line 122: utils.execCmd([constants.EXT_SERVICE, 'ksm', 'stop'],
sudo=True)
Line 123:
--
To view, visit http://gerrit.ovirt.org/8357
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia50087aae112069b2a427fca12168aff975b443e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Laszlo Hornyak <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Doron Fediuck <[email protected]>
Gerrit-Reviewer: Laszlo Hornyak <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches