Skip to contentSkip to conversation

runqueue: Fix collapsed setscene dependency tree

PATCH In review Richard Purdie 2 participants 2 messages Feb 19, 2017 – Feb 20, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 runqueue: Fix collapsed setscene dependency tree

When we removed the postinst sstate dependency handling code from setscene_depvalid, we noticed things being installed into the old style sysroot for rootfs tasks which should not have been there, causing a performance regression.

Analysis revealed that setscene dependencies were "bubbling" over sstate tasks when they should have been stopping there. The 'continue' added by this patch avoids this issue and eusures sstate tasks remain contained to their specific chains.

There was another bug in the code this exposed where the acconting for tasks as they were removed from sq_revdeps was not correct. In fixing this, what looks like a workaround in another test can then be simplified.

After this change, populate_sysroot tasks are no longer depending on package_write_rpm tasks for example, which would make no sense.

A before/after analysis of image dependencies only revealed improved dependencies after this change.

Recipe specific sysroots did highlight the issue here since the behaviour of the sysroot dependencies (and processing with depvalid) was not matching what bitbake itself was doing, with bitbake being incorrect. Failures were 'safe' in that too many dependencies would get installed.

---
 lib/bb/runqueue.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
lib/bb/runqueue.py +4 -1
index 728b5fb..a3b451a 100644
@@ -2010,6 +2010,8 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
         for tid in self.rqdata.runq_setscene_tids:
             #bb.warn("Added endpoint 2 %s" % (tid))
             for dep in self.rqdata.runtaskentries[tid].depends:
+                    if tid in sq_revdeps[dep]:
+                        sq_revdeps[dep].remove(tid)
                     if dep not in endpoints:
                         endpoints[dep] = set()
                     #bb.warn("  Added endpoint 3 %s" % (dep))
@@ -2029,12 +2031,13 @@ class RunQueueExecuteScenequeue(RunQueueExecute):
                 if point in self.rqdata.runq_setscene_tids:
                     sq_revdeps_new[point] = tasks
                     tasks = set()
+                    continue
                 for dep in self.rqdata.runtaskentries[point].depends:
                     if point in sq_revdeps[dep]:
                         sq_revdeps[dep].remove(point)
                     if tasks:
                         sq_revdeps_new[dep] |= tasks
-                    if (len(sq_revdeps[dep]) == 0 or len(sq_revdeps_new[dep]) != 0) and dep not in self.rqdata.runq_setscene_tids:
+                    if len(sq_revdeps[dep]) == 0 and dep not in self.rqdata.runq_setscene_tids:
                         newendpoints[dep] = task
             if len(newendpoints) != 0:
                 process_endpoints(newendpoints)
Signature · 1 line
2.7.4
#1 lore raw
Quoted 8 lines

-----Original Message-----
From: [email protected] [mailto:bitbake- [email protected]] On Behalf Of Richard Purdie
Sent: den 19 februari 2017 15:16
To: [email protected]
Subject: [bitbake-devel] [PATCH] runqueue: Fix collapsed setscene dependency tree

Quoted 8 lines

When we removed the postinst sstate dependency handling code from setscene_depvalid, we noticed things being installed into the old style sysroot for rootfs tasks which should not have been there, causing a performance regression.

Analysis revealed that setscene dependencies were "bubbling" over sstate tasks when they should have been stopping there. The 'continue' added by this patch avoids this issue and eusures

Change "eusures" to "ensures".

Quoted 3 lines

sstate tasks remain contained to their specific chains.

There was another bug in the code this exposed where the acconting

Change "acconting" to "accounting".

Quoted 10 lines

for tasks as they were removed from sq_revdeps was not correct. In fixing this, what looks like a workaround in another test can then be simplified.

After this change, populate_sysroot tasks are no longer depending on package_write_rpm tasks for example, which would make no sense.

A before/after analysis of image dependencies only revealed improved dependencies after this change.

Quoted 7 lines

Recipe specific sysroots did highlight the issue here since the behaviour of the sysroot dependencies (and processing with depvalid) was not matching what bitbake itself was doing, with bitbake being incorrect. Failures were 'safe' in that too many dependencies would get installed.

//Peter