git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Matheus Tavares Bernardino <matheus.bernardino@usp.br>
To: git <git@vger.kernel.org>
Subject: Questions on delta base cache fetching
Date: Sat, 23 Nov 2019 16:54:49 -0300	[thread overview]
Message-ID: <CAHd-oW4gXSEsO7H0f-85vhWheUQ8CtGw5Jh7QP=h_inBpFTJDA@mail.gmail.com> (raw)

Hi, everyone

A few questions popped into my head regarding unpacking functions that
fetch from the delta base cache. Their behavior on the cached entries
sometimes seemed a little counterintuitive for me, so I hoped you
could help me better understand.

1. If cache_or_unpack_entry() finds the desired object in cache, it
just retrieves and returns the entry, not updating its position in the
LRU list. Shouldn't it do so (possibly by removing and re-inserting
the entry)? Or maybe shouldn't the retrieval function itself do the
update?

2. While resolving a delta chain, unpack_entry() checks if the base is
in cache and removes it if so. At first, this seemed a little odd to
me, but the entry is re-inserted at phase 3. FWIU, this is done to
update the entry's position in the LRU list, is that right?

However, if the function is called to unpack a base object which is
already in cache, it will just remove the cache entry and don't
re-insert it (as it won't go through phase 3). Calling the
cache_or_unpack_entry() "wrapper", thought, will, in this case, return
the cache entry without removing it (nor calling unpack_entry()). To
avoid removing recently used entries from the cache, shouldn't
external callers, perhaps, always call the wrapper instead of
unpack_entry()?

Thanks,
Matheus

                 reply	other threads:[~2019-11-23 19:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to='CAHd-oW4gXSEsO7H0f-85vhWheUQ8CtGw5Jh7QP=h_inBpFTJDA@mail.gmail.com' \
    --to=matheus.bernardino@usp.br \
    --cc=git@vger.kernel.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).