All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jose Quaresma <quaresma.jose@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Jose Quaresma <quaresma.jose@gmail.com>
Subject: [PATCH 2/2] sstate: reuse the localdata copy on the mirror thread pool
Date: Tue, 19 Apr 2022 10:46:16 +0100	[thread overview]
Message-ID: <20220419094616.433632-2-quaresma.jose@gmail.com> (raw)
In-Reply-To: <20220419094616.433632-1-quaresma.jose@gmail.com>

We don't need a new copy of the bitbake data [localdata2] in each running
thread of the pool.

We can do the copy on the startup of the thread pool in each thread worker
and reuse it in each running thread, this is the same we did for the
connection_cache which is reused by fetcher.

May be related with [YOCTO #14775] -- https://bugzilla.yoctoproject.org/show_bug.cgi?id=14775

Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
---
 meta/classes/sstate.bbclass | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index ebc336b497..7526ec7562 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -979,6 +979,7 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True,
         from bb.fetch2 import FetchConnectionCache
         def checkstatus_init(thread_worker):
             thread_worker.connection_cache = FetchConnectionCache()
+            thread_worker.localdata2 = bb.data.createCopy(localdata)
 
         def checkstatus_end(thread_worker):
             thread_worker.connection_cache.close_connections()
@@ -986,15 +987,14 @@ def sstate_checkhashes(sq_data, d, siginfo=False, currentcount=0, summary=True,
         def checkstatus(thread_worker, arg):
             (tid, sstatefile) = arg
 
-            localdata2 = bb.data.createCopy(localdata)
             srcuri = "file://" + sstatefile
-            localdata2.setVar('SRC_URI', srcuri)
+            thread_worker.localdata2.setVar('SRC_URI', srcuri)
             bb.debug(2, "SState: Attempting to fetch %s" % srcuri)
 
             import traceback
 
             try:
-                fetcher = bb.fetch2.Fetch(srcuri.split(), localdata2,
+                fetcher = bb.fetch2.Fetch(srcuri.split(), thread_worker.localdata2,
                             connection_cache=thread_worker.connection_cache)
                 fetcher.checkstatus()
                 bb.debug(2, "SState: Successful fetch test for %s" % srcuri)
-- 
2.35.3



  reply	other threads:[~2022-04-19 14:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-19  9:46 [PATCH 1/2] sstate: add a LockedSet class to be used on the mirror thread pool Jose Quaresma
2022-04-19  9:46 ` Jose Quaresma [this message]
2022-04-19 10:57   ` [OE-core] [PATCH 2/2] sstate: reuse the localdata copy " Richard Purdie
2022-04-19 11:55     ` Jose Quaresma
2022-04-28 12:30 ` [OE-core] [PATCH 1/2] sstate: add a LockedSet class to be used " Richard Purdie
2022-04-29 13:32   ` Jose Quaresma
     [not found]   ` <16EA614949E42DAD.4798@lists.openembedded.org>
2022-04-29 13:37     ` Jose Quaresma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220419094616.433632-2-quaresma.jose@gmail.com \
    --to=quaresma.jose@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.