[oe-commits] [bitbake] 04/07: bitbake: runqueue: Reorder task migration changes

git at git.openembedded.org git at git.openembedded.org
Sat Jan 11 23:52:51 UTC 2020


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository bitbake.

commit ce162b6ff9860b21f492ff90445e9f27425231be
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Sun Dec 15 17:50:05 2019 +0000

    bitbake: runqueue: Reorder task migration changes
    
    When a hash changes, rather than removing from the taskgraph, then possibly
    marking it as failed again, switch the ordering of the functions so that
    we only process it if its changed from being invalid to valid.
    
    This reduces the amount of time spent looping around changing tasks to one
    state then back again.
    
    (Bitbake rev: 16b2ff5f500067067da03ef76ede4174512b2005)
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/runqueue.py | 49 +++++++++++++++++++++++++++++++------------------
 1 file changed, 31 insertions(+), 18 deletions(-)

diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index ddc62da..8306f8f 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -2346,7 +2346,13 @@ class RunQueueExecute:
             if tid not in self.pending_migrations:
                 self.pending_migrations.add(tid)
 
-        update_tasks = []
+        #
+        # We have cases where most of the system will see rehashing due to cache matches but the subsequent
+        # hashes won't match, usually due to changes to a core class which means everything has to rerun.
+        # As such we should only migrate a task is its going Valid->Valid, Valid->Invalid or Invalid->Valid
+        # If it was invalid before and is invalid afterwards, we don't need to do all the dependency walking
+        #
+        process_now = []
         for tid in self.pending_migrations.copy():
             if tid in self.runq_running or tid in self.sq_live:
                 # Too late, task already running, not much we can do now
@@ -2362,8 +2368,31 @@ class RunQueueExecute:
                     break
             if not valid:
                 continue
-
+            process_now.append(tid)
             self.pending_migrations.remove(tid)
+
+        origvalid = []
+        for tid in process_now:
+            if tid in self.sqdata.valid:
+                origvalid.append(tid)
+
+            (mc, fn, taskname, taskfn) = split_tid_mcfn(tid)
+            self.sqdata.stamps[tid] = bb.build.stampfile(taskname + "_setscene", self.rqdata.dataCaches[mc], taskfn, noextra=True)
+
+            if tid in self.stampcache:
+                del self.stampcache[tid]
+
+            if tid in self.build_stamps:
+                del self.build_stamps[tid]
+
+        if process_now:
+            self.sqdone = False
+            update_scenequeue_data(set(process_now), self.sqdata, self.rqdata, self.rq, self.cooker, self.stampcache, self, summary=False)
+        for tid in process_now.copy():
+            if tid not in self.sqdata.valid and not origvalid:
+                process_now.remove(tid)
+
+        for tid in process_now:
             changed = True
 
             if tid in self.tasks_scenequeue_done:
@@ -2403,22 +2432,6 @@ class RunQueueExecute:
             if tid in self.scenequeue_notneeded:
                 self.scenequeue_notneeded.remove(tid)
 
-            (mc, fn, taskname, taskfn) = split_tid_mcfn(tid)
-            self.sqdata.stamps[tid] = bb.build.stampfile(taskname + "_setscene", self.rqdata.dataCaches[mc], taskfn, noextra=True)
-
-            if tid in self.stampcache:
-                del self.stampcache[tid]
-
-            if tid in self.build_stamps:
-                del self.build_stamps[tid]
-
-            update_tasks.append((tid, harddepfail, tid in self.sqdata.valid))
-
-        if update_tasks:
-            self.sqdone = False
-            update_scenequeue_data([t[0] for t in update_tasks], self.sqdata, self.rqdata, self.rq, self.cooker, self.stampcache, self, summary=False)
-
-        for (tid, harddepfail, origvalid) in update_tasks:
             if tid in self.sqdata.valid and not origvalid:
                 logger.info("Setscene task %s became valid" % tid)
             if harddepfail:

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list