summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2024-05-24 12:00:01 +0100
committerSteve Sakoman <steve@sakoman.com>2024-06-06 06:53:49 -0700
commitcc341e44bfbfe4e5dedac8ca6ccd438a50c3db11 (patch)
tree031a6a2a292dc5967c54696835a6fbcfeb94756d /bitbake
parentfa23d0fc6d7adca5c8a38169f4477755ee33bdbf (diff)
downloadpoky-cc341e44bfbfe4e5dedac8ca6ccd438a50c3db11.tar.gz
bitbake: runqueue: Process unihashes in parallel at init
Improve the runqueue init code to call unihash queries in parallel since this is faster and more efficient, particularly on slower links with longer round trip times. The call to the function from cooker is unneeded since that function calls prepare() and hence this functionality will already have run, so drop that obsolete call. (Bitbake rev: e0486054c7a4c637446c18608e9983cc8dc4d7fe) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/cooker.py1
-rw-r--r--bitbake/lib/bb/runqueue.py18
2 files changed, 10 insertions, 9 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 939a999974..6318ef4a8f 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -1459,7 +1459,6 @@ class BBCooker:
1459 1459
1460 if t in task or getAllTaskSignatures: 1460 if t in task or getAllTaskSignatures:
1461 try: 1461 try:
1462 rq.rqdata.prepare_task_hash(tid)
1463 sig.append([pn, t, rq.rqdata.get_task_unihash(tid)]) 1462 sig.append([pn, t, rq.rqdata.get_task_unihash(tid)])
1464 except KeyError: 1463 except KeyError:
1465 sig.append(self.getTaskSignatures(target, [t])[0]) 1464 sig.append(self.getTaskSignatures(target, [t])[0])
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 84a6f4172c..999868dd72 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -1280,11 +1280,18 @@ class RunQueueData:
1280 dealtwith = set() 1280 dealtwith = set()
1281 todeal = set(self.runtaskentries) 1281 todeal = set(self.runtaskentries)
1282 while todeal: 1282 while todeal:
1283 ready = set()
1283 for tid in todeal.copy(): 1284 for tid in todeal.copy():
1284 if not (self.runtaskentries[tid].depends - dealtwith): 1285 if not (self.runtaskentries[tid].depends - dealtwith):
1285 dealtwith.add(tid) 1286 self.runtaskentries[tid].taskhash_deps = bb.parse.siggen.prep_taskhash(tid, self.runtaskentries[tid].depends, self.dataCaches)
1286 todeal.remove(tid) 1287 # get_taskhash for a given tid *must* be called before get_unihash* below
1287 self.prepare_task_hash(tid) 1288 self.runtaskentries[tid].hash = bb.parse.siggen.get_taskhash(tid, self.runtaskentries[tid].depends, self.dataCaches)
1289 ready.add(tid)
1290 unihashes = bb.parse.siggen.get_unihashes(ready)
1291 for tid in ready:
1292 dealtwith.add(tid)
1293 todeal.remove(tid)
1294 self.runtaskentries[tid].unihash = unihashes[tid]
1288 1295
1289 bb.event.check_for_interrupts(self.cooker.data) 1296 bb.event.check_for_interrupts(self.cooker.data)
1290 1297
@@ -1301,11 +1308,6 @@ class RunQueueData:
1301 #self.dump_data() 1308 #self.dump_data()
1302 return len(self.runtaskentries) 1309 return len(self.runtaskentries)
1303 1310
1304 def prepare_task_hash(self, tid):
1305 self.runtaskentries[tid].taskhash_deps = bb.parse.siggen.prep_taskhash(tid, self.runtaskentries[tid].depends, self.dataCaches)
1306 self.runtaskentries[tid].hash = bb.parse.siggen.get_taskhash(tid, self.runtaskentries[tid].depends, self.dataCaches)
1307 self.runtaskentries[tid].unihash = bb.parse.siggen.get_unihash(tid)
1308
1309 def dump_data(self): 1311 def dump_data(self):
1310 """ 1312 """
1311 Dump some debug information on the internal data structures 1313 Dump some debug information on the internal data structures