diff mbox series

[2/2] runqueue: Fix deadlocked task issue for multiconfigs

Message ID 20261117114550.2306278-2-richard.purdie@linuxfoundation.org
State New
Headers show
Series [1/2] runqueue: Improve deferred task sorting | expand

Commit Message

Richard Purdie Nov. 17, 2026, 11:45 a.m. UTC
Some builds were showing large numbers of deadlocked tasks. I tracked this
down to the case where there is a large amount of sstate available and tasks
are able to be skipped even though they were deferred.

If a task was deferred and skipped, it was left in the deferred list. Fix
this by adding a case in the handling code and removing such tasks.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 lib/bb/runqueue.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index 4f80f1fde21..501fb92dc49 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -2117,7 +2117,11 @@  class RunQueueExecute:
 
         found = None
         for t in sort_tids_by_mc(self.sq_deferred.copy(), self.sqdata.multiconfigs):
-            if self.sq_deferred[t] == task:
+            if t == task:
+                # The deferred task was probably skipped, we can just remove it from the queue
+                del self.sq_deferred[t]
+                update_scenequeue_data([t], self.sqdata, self.rqdata, self.rq, self.cooker, self.stampcache, self, summary=False)
+            elif self.sq_deferred[t] == task:
                 # Allow the next deferred task to run. Any other deferred tasks should be deferred after that task.
                 # We shouldn't allow all to run at once as it is prone to races.
                 if not found: