[bitbake-devel] [PATCH 2/3] runqueue: Further optimise holdoff tasks

Richard Purdie richard.purdie at linuxfoundation.org
Fri Aug 16 16:16:36 UTC 2019


There are other data structures which can be reprocessed at the same
time as holdoff_tasks, further improving build efficiency in various
places.

Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/runqueue.py | 49 +++++++++++++++++++++++-----------------------
 1 file changed, 25 insertions(+), 24 deletions(-)

diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index 0c17a23bdc..a98ccddd09 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -2040,6 +2040,8 @@ class RunQueueExecute:
             if self.can_start_task():
                 return True
 
+        self.update_holdofftasks()
+
         if not self.sq_live and not self.sqdone and not self.sq_deferred and not self.updated_taskhash_queue and not self.holdoff_tasks:
             logger.info("Setscene tasks completed")
 
@@ -2058,8 +2060,6 @@ class RunQueueExecute:
                 self.rq.state = runQueueComplete
                 return True
 
-        self.update_holdofftasks()
-
         if self.cooker.configuration.setsceneonly:
             task = None
         else:
@@ -2200,6 +2200,29 @@ class RunQueueExecute:
 
         if not self.holdoff_need_update:
             return
+
+        notcovered = set(self.scenequeue_notcovered)
+        notcovered |= self.cantskip
+        for tid in self.scenequeue_notcovered:
+            notcovered |= self.sqdata.sq_covered_tasks[tid]
+        notcovered |= self.sqdata.unskippable.difference(self.rqdata.runq_setscene_tids)
+        notcovered.intersection_update(self.tasks_scenequeue_done)
+
+        covered = set(self.scenequeue_covered)
+        for tid in self.scenequeue_covered:
+            covered |= self.sqdata.sq_covered_tasks[tid]
+        covered.difference_update(notcovered)
+        covered.intersection_update(self.tasks_scenequeue_done)
+
+        for tid in notcovered | covered:
+            if len(self.rqdata.runtaskentries[tid].depends) == 0:
+                self.setbuildable(tid)
+            elif self.rqdata.runtaskentries[tid].depends.issubset(self.runq_complete):
+                 self.setbuildable(tid)
+
+        self.tasks_covered = covered
+        self.tasks_notcovered = notcovered
+
         self.holdoff_tasks = set()
 
         for tid in self.rqdata.runq_setscene_tids:
@@ -2359,28 +2382,6 @@ class RunQueueExecute:
                         new.add(dep)
             next = new
 
-        notcovered = set(self.scenequeue_notcovered)
-        notcovered |= self.cantskip
-        for tid in self.scenequeue_notcovered:
-            notcovered |= self.sqdata.sq_covered_tasks[tid]
-        notcovered |= self.sqdata.unskippable.difference(self.rqdata.runq_setscene_tids)
-        notcovered.intersection_update(self.tasks_scenequeue_done)
-
-        covered = set(self.scenequeue_covered)
-        for tid in self.scenequeue_covered:
-            covered |= self.sqdata.sq_covered_tasks[tid]
-        covered.difference_update(notcovered)
-        covered.intersection_update(self.tasks_scenequeue_done)
-
-        for tid in notcovered | covered:
-            if len(self.rqdata.runtaskentries[tid].depends) == 0:
-                self.setbuildable(tid)
-            elif self.rqdata.runtaskentries[tid].depends.issubset(self.runq_complete):
-                 self.setbuildable(tid)
-
-        self.tasks_covered = covered
-        self.tasks_notcovered = notcovered
-
         self.holdoff_need_update = True
 
     def sq_task_completeoutright(self, task):
-- 
2.20.1



More information about the bitbake-devel mailing list