summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/server
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2015-03-10 10:29:46 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-03-10 10:37:28 +0000
commit0467d530179b658f6a3630526d44858f0cab3024 (patch)
tree52623c5836b74a200211c4dc096ec820258c973c /bitbake/lib/bb/server
parent8ce2f2c3549248b2aa1259ceb28ed03be166ac6f (diff)
downloadpoky-0467d530179b658f6a3630526d44858f0cab3024.tar.gz
bitbake: cooker/server: Fix up 100% CPU usage at idle
The recent inotify changes are causing a 100% cpu usage issue in the idle handlers. To avoid this, we update the idle functions to optionally report a float value which is the delay before the function needs to be called again. 1 second is fine for the inotify handler, in reality its more like 0.1s due to the default idle function sleep. This reverts performance regressions of 1.5 minutes on a kernel build and ~5-6 minutes on a image from scratch. (Bitbake rev: 0e0ba408c2dce14a0fabd3fdf61d8465a031495b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/server')
-rw-r--r--bitbake/lib/bb/server/process.py3
-rw-r--r--bitbake/lib/bb/server/xmlrpc.py3
2 files changed, 6 insertions, 0 deletions
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py
index 7671b26a80..c9286ddba7 100644
--- a/bitbake/lib/bb/server/process.py
+++ b/bitbake/lib/bb/server/process.py
@@ -135,6 +135,9 @@ class ProcessServer(Process, BaseImplServer):
135 nextsleep = None 135 nextsleep = None
136 elif retval is True: 136 elif retval is True:
137 nextsleep = None 137 nextsleep = None
138 elif isinstance(retval, float):
139 if (retval < nextsleep):
140 nextsleep = retval
138 elif nextsleep is None: 141 elif nextsleep is None:
139 continue 142 continue
140 else: 143 else:
diff --git a/bitbake/lib/bb/server/xmlrpc.py b/bitbake/lib/bb/server/xmlrpc.py
index 17f3d9d906..75ec8556f4 100644
--- a/bitbake/lib/bb/server/xmlrpc.py
+++ b/bitbake/lib/bb/server/xmlrpc.py
@@ -242,6 +242,9 @@ class XMLRPCServer(SimpleXMLRPCServer, BaseImplServer):
242 del self._idlefuns[function] 242 del self._idlefuns[function]
243 elif retval is True: 243 elif retval is True:
244 nextsleep = 0 244 nextsleep = 0
245 elif isinstance(retval, float):
246 if (retval < nextsleep):
247 nextsleep = retval
245 else: 248 else:
246 fds = fds + retval 249 fds = fds + retval
247 except SystemExit: 250 except SystemExit: