diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-04-10 15:57:07 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-04-11 16:21:48 +0100 |
| commit | c18e52c0c868253e40bb25734f742edbd764033d (patch) | |
| tree | 4f87ae0b2a7bfdb25f3ad793b6b849e325fda30a /bitbake/lib/bb | |
| parent | 8e64c535af64bb58e98be2d65398c50c23c6e52d (diff) | |
| download | poky-c18e52c0c868253e40bb25734f742edbd764033d.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)
(Bitbake rev: 88dfe16b5abd804bae0c1e3b60cb93cb951cbc3f)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
| -rw-r--r-- | bitbake/lib/bb/cooker.py | 2 | ||||
| -rw-r--r-- | bitbake/lib/bb/server/process.py | 3 | ||||
| -rw-r--r-- | bitbake/lib/bb/server/xmlrpc.py | 3 |
3 files changed, 7 insertions, 1 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 2f2a8523af..aeb3f71e2f 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
| @@ -142,7 +142,7 @@ class BBCooker: | |||
| 142 | # read notified events and enqeue them | 142 | # read notified events and enqeue them |
| 143 | n.read_events() | 143 | n.read_events() |
| 144 | n.process_events() | 144 | n.process_events() |
| 145 | return True | 145 | return 1.0 |
| 146 | 146 | ||
| 147 | self.configuration.server_register_idlecallback(_process_inotify_updates, [self.confignotifier, self.notifier]) | 147 | self.configuration.server_register_idlecallback(_process_inotify_updates, [self.confignotifier, self.notifier]) |
| 148 | 148 | ||
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py index d362f8d7fe..302ee5fc8a 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 4205a4c35f..10d4b5c779 100644 --- a/bitbake/lib/bb/server/xmlrpc.py +++ b/bitbake/lib/bb/server/xmlrpc.py | |||
| @@ -241,6 +241,9 @@ class XMLRPCServer(SimpleXMLRPCServer, BaseImplServer): | |||
| 241 | del self._idlefuns[function] | 241 | del self._idlefuns[function] |
| 242 | elif retval is True: | 242 | elif retval is True: |
| 243 | nextsleep = 0 | 243 | nextsleep = 0 |
| 244 | elif isinstance(retval, float): | ||
| 245 | if (retval < nextsleep): | ||
| 246 | nextsleep = retval | ||
| 244 | else: | 247 | else: |
| 245 | fds = fds + retval | 248 | fds = fds + retval |
| 246 | except SystemExit: | 249 | except SystemExit: |
