All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joshua Lock <josh@linux.intel.com>
To: "poky@yoctoproject.org" <poky@yoctoproject.org>
Subject: Re: Processing extra field requested by bitbake -u in Cache
Date: Wed, 27 Apr 2011 11:39:03 -0700	[thread overview]
Message-ID: <1303929543.2242.20.camel@scimitar> (raw)
In-Reply-To: <789F9655DD1B8F43B48D77C5D30659734C09DCDE@shsmsx501.ccr.corp.intel.com>

On Wed, 2011-04-27 at 17:34 +0800, Ke, Liping wrote:
> Hi, all
> 
> I am looking @ bug 770 Add mechanism to enable UI's to request extra
> data be stored in the cache. We are now thinking about the possible
> solutions.

For people wishing to follow:
http://bugzilla.pokylinux.org/show_bug.cgi?id=770

> 
> There are two choices:
> 1. Store extra cache fields in a separated small cache file, so non-ui mode will only fetch the base cache file, if in ui-mode, it will load the extra small cache (with the extra 3 fields, such as summary)
>   Advantage: 1) Will 'not' change the cache invalidation mechanism. For non-ui mode, it will go the old path. If extra fields are required (ui-mode), we need to load the extra field into the memory.
>             2) disk file size is optimized
>   Disadvantage: cache code change will be big, since all data load/sync/ methods need to be modified.

Why must we change the invalidation mechanisms when having a separate
cache file per UI.

My thought is that we'll have a cache file name which encodes the UI and
then run the usual invalidation tests against that cache.

Say that the UI name is known by the cache and stored in variable
currentui we can achieve this by:

-        self.cachefile = os.path.join(self.cachedir, "bb_cache.dat")
+        self.cachefile = os.path.join(self.cachedir, "bb_cache_%s.dat"
% currentui)

Also, surely we *do* need alter the cache invalidation mechanisms for
multiple files, at least insofar as we must test more than one cache
file some times.

> 
> 2. Have two big cache files, one is for ui mode, one is for non-ui mode
>   Advantage: Code change will be a little smaller. When loading, if it's non-ui mode, load smaller cache file. Otherwise, load bigger cache file.  
>   Disadvantage: 1) Cache invalidation mechanism (timestamp) is broken. When mode switching, we need to invalidate all caches, reparsing, reloading time 30s.
>               s) disk file size is bigger. 2*original_size (2*6M)

I'm not sure that 6MB disk overhead is worth the code complexity
increase by having multiple cache files stitched together.

I am definitely keen to hear others opinions here.

Cheers,
Joshua
-- 
Joshua Lock
        Yocto Build System Monkey
        Intel Open Source Technology Centre




  reply	other threads:[~2011-04-27 18:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-27  9:34 Processing extra field requested by bitbake -u in Cache Ke, Liping
2011-04-27 18:39 ` Joshua Lock [this message]
2011-04-28  1:22   ` Ke, Liping
2011-04-28  2:22     ` Joshua Lock
2011-04-28  2:40       ` Ke, Liping

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=1303929543.2242.20.camel@scimitar \
    --to=josh@linux.intel.com \
    --cc=poky@yoctoproject.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.