Skip to contentSkip to conversation

siggen: Drop copy_unihashes function

PATCH In review Richard Purdie 3 participants 6 messages Jun 4, 2024 – Jun 8, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 siggen: Drop copy_unihashes function

The code in OE-Core using this has been replaced with something more fit for purpose. Drop these function calls as they were never a great idea in the first place and cause IO slowdown for runqueue needing to sync the cache.

---
 lib/bb/siggen.py | 6 ------
 1 file changed, 6 deletions(-)
lib/bb/siggen.py +0 -6
index 92066da00c..89b70fb6a4 100644
@@ -201,9 +201,6 @@ class SignatureGenerator(object):
     def save_unitaskhashes(self):
         return
 
-    def copy_unitaskhashes(self, targetdir):
-        return
-
     def set_setscene_tasks(self, setscene_tasks):
         return
 
@@ -418,9 +415,6 @@ class SignatureGeneratorBasic(SignatureGenerator):
     def save_unitaskhashes(self):
         self.unihash_cache.save(self.unitaskhashes)
 
-    def copy_unitaskhashes(self, targetdir):
-        self.unihash_cache.copyfile(targetdir)
-
     def dump_sigtask(self, mcfn, task, stampbase, runtime):
         tid = mcfn + ":" + task
         mc = bb.runqueue.mc_from_tid(mcfn)
#1 lore raw

PATCH 2/2 runqueue: Avoid save_unitaskhashes

The save comes with an IO overhead which can slow down the rehash loop in bitbake a lot. We only needed to do this when recipes were doing unihash cache copying. Now they aren't doing that, drop this IO pain point.

---
 lib/bb/runqueue.py | 3 ---
 1 file changed, 3 deletions(-)
lib/bb/runqueue.py +0 -3
index 93079a9776..3462ed4457 100644
@@ -2550,9 +2550,6 @@ class RunQueueExecute:
                     self.rqdata.runtaskentries[hashtid].unihash = unihash
                     bb.parse.siggen.set_unihash(hashtid, unihash)
                     toprocess.add(hashtid)
-                if torehash:
-                    # Need to save after set_unihash above
-                    bb.parse.siggen.save_unitaskhashes()
 
         # Work out all tasks which depend upon these
         total = set()
#2 lore raw
In reply to Richard Purdie

Hello Richard,

Quoted 24 lines · Richard Purdie

The code in OE-Core using this has been replaced with something more fit for purpose. Drop these function calls as they were never a great idea in the first place and cause IO slowdown for runqueue needing to sync the cache.

---
 lib/bb/siggen.py | 6 ------
 1 file changed, 6 deletions(-)
lib/bb/siggen.py +0 -3
index 92066da00c..89b70fb6a4 100644
@@ -201,9 +201,6 @@ class SignatureGenerator(object):
     def save_unitaskhashes(self):
         return
 
-    def copy_unitaskhashes(self, targetdir):
-        return
-
     def set_setscene_tasks(self, setscene_tasks):
         return
 

lib/bb/siggen.py class SignatureGeneratorBasic(SignatureGenerator): · line 423

Quoted 6 lines
lib/bb/siggen.py +0 -3
@@ -418,9 +415,6 @@ class SignatureGeneratorBasic(SignatureGenerator):
     def save_unitaskhashes(self):
         self.unihash_cache.save(self.unitaskhashes)
 
-    def copy_unitaskhashes(self, targetdir):
-        self.unihash_cache.copyfile(targetdir)
-

It breaks sstatetests.SStateBundles.test_minimal_bundle which uses copy_unitaskhashes

Quoted 13 lines
lib/bb/siggen.py +0 -1
     def dump_sigtask(self, mcfn, task, stampbase, runtime):
         tid = mcfn + ":" + task
         mc = bb.runqueue.mc_from_tid(mcfn)
 
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#16316): https://lists.openembedded.org/g/bitbake-devel/message/16316
Mute This Topic: https://lists.openembedded.org/mt/106483284/3617179
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw
Quoted 33 lines · Alexandre Belloni

Hello Richard,

Quoted 29 lines · Richard Purdie

The code in OE-Core using this has been replaced with something more fit
for purpose. Drop these function calls as they were never a great idea in the
first place and cause IO slowdown for runqueue needing to sync the cache.

---
 lib/bb/siggen.py | 6 ------

 1 file changed, 6 deletions(-)
lib/bb/siggen.py +0 -0
index 92066da00c..89b70fb6a4 100644
@@ -201,9 +201,6 @@ class SignatureGenerator(object):

     def save_unitaskhashes(self):
         return

-    def copy_unitaskhashes(self, targetdir):
-        return
-
     def set_setscene_tasks(self, setscene_tasks):
         return

lib/bb/siggen.py +0 -0
@@ -418,9 +415,6 @@ class

SignatureGeneratorBasic(SignatureGenerator):
     def save_unitaskhashes(self):

Quoted 8 lines
Quoted 5 lines

         self.unihash_cache.save(self.unitaskhashes)
-    def copy_unitaskhashes(self, targetdir):
-        self.unihash_cache.copyfile(targetdir) -

It breaks sstatetests.SStateBundles.test_minimal_bundle which uses copy_unitaskhashes

Is that patch only in your -next branch? I didn't see this issue in my own testing which makes me wonder...

Cheers,

Richard

#4 lore raw

I think it’s in my patch set for build replication that needs to be reworked to not use the function and should be dropped until then.

Alex

Quoted 63 lines · Richard Purdie via lists.openembedded.org
Quoted 35 lines · Alexandre Belloni

Hello Richard,

Quoted 31 lines · Richard Purdie

The code in OE-Core using this has been replaced with something more fit
for purpose. Drop these function calls as they were never a great idea in the
first place and cause IO slowdown for runqueue needing to sync the cache.

---
 lib/bb/siggen.py | 6 ------
 1 file changed, 6 deletions(-)
lib/bb/siggen.py +0 -3
index 92066da00c..89b70fb6a4 100644
@@ -201,9 +201,6 @@ class SignatureGenerator(object):
     def save_unitaskhashes(self):
         return
 
-    def copy_unitaskhashes(self, targetdir):
-        return
-
     def set_setscene_tasks(self, setscene_tasks):
         return
 
@@ -418,9 +415,6 @@ class

SignatureGeneratorBasic(SignatureGenerator):
def save_unitaskhashes(self):
self.unihash_cache.save(self.unitaskhashes)

Quoted 6 lines

lib/bb/siggen.py class SignatureGeneratorBasic(SignatureGenerator): · line 423

Quoted 3 lines
lib/bb/siggen.py +0 -3
-    def copy_unitaskhashes(self, targetdir):
-        self.unihash_cache.copyfile(targetdir)
-

It breaks sstatetests.SStateBundles.test_minimal_bundle which uses copy_unitaskhashes

Is that patch only in your -next branch? I didn't see this issue in my own testing which makes me wonder...

Cheers,

Richard

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#16331):
https://lists.openembedded.org/g/bitbake-devel/message/16331
Mute This Topic: https://lists.openembedded.org/mt/106483284/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#5 lore raw
In reply to Richard Purdie
Quoted 44 lines · Richard Purdie
Quoted 33 lines · Alexandre Belloni

Hello Richard,

Quoted 29 lines · Richard Purdie

The code in OE-Core using this has been replaced with something more fit
for purpose. Drop these function calls as they were never a great idea in the
first place and cause IO slowdown for runqueue needing to sync the cache.

---
�lib/bb/siggen.py | 6 ------
�1 file changed, 6 deletions(-)

lib/bb/siggen.py +0 -0
index 92066da00c..89b70fb6a4 100644
@@ -201,9 +201,6 @@ class SignatureGenerator(object):

���� def save_unitaskhashes(self):
�������� return
�
-��� def copy_unitaskhashes(self, targetdir):
-������� return
-
���� def set_setscene_tasks(self, setscene_tasks):
�������� return
�

lib/bb/siggen.py +0 -0
@@ -418,9 +415,6 @@ class

SignatureGeneratorBasic(SignatureGenerator):
���� def save_unitaskhashes(self):

Quoted 8 lines
Quoted 5 lines

�������� self.unihash_cache.save(self.unitaskhashes) �
-��� def copy_unitaskhashes(self, targetdir):
-������� self.unihash_cache.copyfile(targetdir) -

It breaks sstatetests.SStateBundles.test_minimal_bundle which uses copy_unitaskhashes

Quoted 2 lines

Is that patch only in your -next branch? I didn't see this issue in my own testing which makes me wonder...

You are right, git blame told me it was applied a month ag and I didn't check further. I'll drop the patch.

Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com