summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2024-11-29 12:51:23 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-11-29 22:13:25 +0000
commit05b02e3d57c0cac37694bd3dcf3c8e04c63d75bd (patch)
treee1291444297ba285523bbab9c10c6acc939a0953 /bitbake/lib
parentad9d89fde6250c728851908e3032d47f49ff3cd5 (diff)
downloadpoky-05b02e3d57c0cac37694bd3dcf3c8e04c63d75bd.tar.gz
bitbake: runqueue: Fix performance of multiconfigs with large overlap
There have been complaints about the performance of large multiconfig builds for a while. The key missing data point was that the builds needed to have large overlaps in sstate objects. This can be simulated by building the same things with just different TMPDIRs. In runqueue/bitbake terms this equates to large numbers of deferred tasks. The issue is that the expensive checks in the setscene loop were hit every time through runqueue's execute function before the check on deferred tasks. This leads to task execution starvation as that only happens once per iteration. Move the skip check earlier in the function which speeds things up enormously and should improve performance of such builds for users. (Bitbake rev: 9c6c506757f2b3e28c8b20513b45da6b4659c95f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/runqueue.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 61608ac603..2179ee1302 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -2210,6 +2210,9 @@ class RunQueueExecute:
2210 # Find the next setscene to run 2210 # Find the next setscene to run
2211 for nexttask in self.sorted_setscene_tids: 2211 for nexttask in self.sorted_setscene_tids:
2212 if nexttask in self.sq_buildable and nexttask not in self.sq_running and self.sqdata.stamps[nexttask] not in self.build_stamps.values() and nexttask not in self.sq_harddep_deferred: 2212 if nexttask in self.sq_buildable and nexttask not in self.sq_running and self.sqdata.stamps[nexttask] not in self.build_stamps.values() and nexttask not in self.sq_harddep_deferred:
2213 if nexttask in self.sq_deferred and self.sq_deferred[nexttask] not in self.runq_complete:
2214 # Skip deferred tasks quickly before the 'expensive' tests below - this is key to performant multiconfig builds
2215 continue
2213 if nexttask not in self.sqdata.unskippable and self.sqdata.sq_revdeps[nexttask] and \ 2216 if nexttask not in self.sqdata.unskippable and self.sqdata.sq_revdeps[nexttask] and \
2214 nexttask not in self.sq_needed_harddeps and \ 2217 nexttask not in self.sq_needed_harddeps and \
2215 self.sqdata.sq_revdeps[nexttask].issubset(self.scenequeue_covered) and \ 2218 self.sqdata.sq_revdeps[nexttask].issubset(self.scenequeue_covered) and \
@@ -2239,8 +2242,7 @@ class RunQueueExecute:
2239 if t in self.runq_running and t not in self.runq_complete: 2242 if t in self.runq_running and t not in self.runq_complete:
2240 continue 2243 continue
2241 if nexttask in self.sq_deferred: 2244 if nexttask in self.sq_deferred:
2242 if self.sq_deferred[nexttask] not in self.runq_complete: 2245 # Deferred tasks that were still deferred were skipped above so we now need to process
2243 continue
2244 logger.debug("Task %s no longer deferred" % nexttask) 2246 logger.debug("Task %s no longer deferred" % nexttask)
2245 del self.sq_deferred[nexttask] 2247 del self.sq_deferred[nexttask]
2246 valid = self.rq.validate_hashes(set([nexttask]), self.cooker.data, 0, False, summary=False) 2248 valid = self.rq.validate_hashes(set([nexttask]), self.cooker.data, 0, False, summary=False)