All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] runqueue: Fix issues with multiconfig deferred task deadlock messages
@ 2021-09-07 11:15 Richard Purdie
  2021-09-07 11:15 ` [PATCH 2/2] runqueue: Avoid deadlock avoidance task graph corruption Richard Purdie
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Purdie @ 2021-09-07 11:15 UTC (permalink / raw)
  To: bitbake-devel

In multiconfig builds with large numbers of identical tasks, builds were
deadlocking after recent runqueue changes upon rebuilds where there was
heavy sstate usage (i.e. on second builds after a first completed).

The issue was that deferred tasks were being left indefinitely on
the deferred list. The deadlock handler was then "breaking" things
by failing tasks that had already succeeded, leading to the task
being on both covered and not covered lists, giving a further error.

The fix is to clean up the deferred task list when each setscene task
completes. I'd previously been hoping to avoid iterating that list
but it appears unavoidable.

[YOCTO #14342]

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

diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index 25e012125c..c652f3eaf7 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -2492,6 +2492,11 @@ class RunQueueExecute:
 
         self.holdoff_need_update = True
 
+        for t in self.sq_deferred.copy():
+            if self.sq_deferred[t] == task:
+                logger.debug2("Deferred task %s now buildable" % t)
+                del self.sq_deferred[t]
+
     def sq_task_completeoutright(self, task):
         """
         Mark a task as completed
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2] runqueue: Avoid deadlock avoidance task graph corruption
  2021-09-07 11:15 [PATCH 1/2] runqueue: Fix issues with multiconfig deferred task deadlock messages Richard Purdie
@ 2021-09-07 11:15 ` Richard Purdie
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Purdie @ 2021-09-07 11:15 UTC (permalink / raw)
  To: bitbake-devel

If the deferred task deadlock avoidance code triggers, it could mark an executed
task as failed which leads to "covered and not covered" error messages. Improve
the logic so if the deadlock code is triggered, it doesn't cause the errors.

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

diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index c652f3eaf7..05ca5c4e88 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -2180,7 +2180,8 @@ class RunQueueExecute:
         if self.sq_deferred:
             tid = self.sq_deferred.pop(list(self.sq_deferred.keys())[0])
             logger.warning("Runqeueue deadlocked on deferred tasks, forcing task %s" % tid)
-            self.sq_task_failoutright(tid)
+            if tid not in self.runq_complete:
+                self.sq_task_failoutright(tid)
             return True
 
         if len(self.failed_tids) != 0:
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-07 11:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-07 11:15 [PATCH 1/2] runqueue: Fix issues with multiconfig deferred task deadlock messages Richard Purdie
2021-09-07 11:15 ` [PATCH 2/2] runqueue: Avoid deadlock avoidance task graph corruption Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.