1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-08 05:09:24 +00:00

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>
This commit is contained in:
Richard Purdie
2015-03-10 10:29:46 +00:00
parent 8ce2f2c354
commit 0467d53017
3 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -142,7 +142,7 @@ class BBCooker:
# read notified events and enqeue them
n.read_events()
n.process_events()
return True
return 1.0
self.configuration.server_register_idlecallback(_process_inotify_updates, [self.confignotifier, self.notifier])
+3
View File
@@ -135,6 +135,9 @@ class ProcessServer(Process, BaseImplServer):
nextsleep = None
elif retval is True:
nextsleep = None
elif isinstance(retval, float):
if (retval < nextsleep):
nextsleep = retval
elif nextsleep is None:
continue
else:
+3
View File
@@ -242,6 +242,9 @@ class XMLRPCServer(SimpleXMLRPCServer, BaseImplServer):
del self._idlefuns[function]
elif retval is True:
nextsleep = 0
elif isinstance(retval, float):
if (retval < nextsleep):
nextsleep = retval
else:
fds = fds + retval
except SystemExit: