tuned: lowered CPU usage due to python bug
Resolves: rhbz#917587 Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
This commit is contained in:
parent
35a3eb2398
commit
d3160b8a33
3 changed files with 9 additions and 2 deletions
|
|
@ -28,7 +28,7 @@ class Controller(tuned.exports.interfaces.ExportableInterface):
|
|||
|
||||
self._terminate.clear()
|
||||
# we have to pass some timeout, otherwise signals will not work
|
||||
while not self._terminate.wait(3600):
|
||||
while not tuned.utils.commands.wait(self._terminate, 3600):
|
||||
pass
|
||||
|
||||
log.info("terminating controller")
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import threading
|
|||
import tuned.logs
|
||||
from tuned.exceptions import TunedException
|
||||
import tuned.consts as consts
|
||||
import tuned.utils.commands
|
||||
|
||||
log = tuned.logs.get()
|
||||
|
||||
|
|
@ -65,7 +66,7 @@ class Daemon(object):
|
|||
self._unit_manager.start_tuning()
|
||||
|
||||
self._terminate.clear()
|
||||
while not self._terminate.wait(self._update_interval):
|
||||
while not tuned.utils.commands.wait(self._terminate, self._update_interval):
|
||||
log.debug("updating monitors")
|
||||
self._unit_manager.update_monitors()
|
||||
log.debug("performing tunings")
|
||||
|
|
|
|||
|
|
@ -85,3 +85,9 @@ def recommend_profile():
|
|||
if match1 and match2:
|
||||
profile = section
|
||||
return profile
|
||||
|
||||
def wait(terminate, time):
|
||||
try:
|
||||
return terminate.wait(time, False)
|
||||
except:
|
||||
return terminate.wait(time)
|
||||
|
|
|
|||
Loading…
Reference in a new issue