From: Derrick Stolee <stolee@gmail.com>
To: Arijit Banerjee via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
"Junio C Hamano" <gitster@pobox.com>, "Jeff King" <peff@peff.net>,
"Arijit Banerjee" <arijit91@gmail.com>,
"Arijit Banerjee" <arijit@effectiveailabs.com>
Subject: Re: [PATCH v3] index-pack: retain child bases in delta cache
Date: Wed, 3 Jun 2026 08:24:36 -0400 [thread overview]
Message-ID: <c4a32a6f-70bf-4ff4-abbf-d6e301246b5b@gmail.com> (raw)
In-Reply-To: <pull.2131.v3.git.1780445118653.gitgitgadget@gmail.com>
On 6/2/26 8:05 PM, Arijit Banerjee via GitGitGadget wrote:
> Changes since v2:
>
> * Addressed Jeff King's review question by releasing cached base data
> after all direct children have been dispatched, while keeping the
> existing subtree bookkeeping intact.
> * Re-ran t/t5302-pack-index.sh, p5302-pack-index.sh, and end-to-end
> full clone spot checks with the precise-release version.
...
> +static int base_data_has_remaining_direct_children(struct base_data *c)
> +{
> + return c->ref_first <= c->ref_last ||
> + c->ofs_first <= c->ofs_last;
> +}
> +
I'm glad you were able to find some bookkeeping that already exists to
help with this decision.
> static void prune_base_data(struct base_data *retain)
> {
> struct list_head *pos;
> @@ -1201,8 +1207,12 @@ static void *threaded_second_pass(void *data)
> }
>
> work_lock();
> - if (parent)
> + if (parent) {
> parent->retain_data--;
> + if (!parent->retain_data &&
> + !base_data_has_remaining_direct_children(parent))
> + free_base_data(parent);
> + }
This appears like the correct place to do this.
> if (child && child->data) {
> /*
> @@ -1212,7 +1222,6 @@ static void *threaded_second_pass(void *data)
> list_add(&child->list, &work_head);
> base_cache_used += child->size;
> prune_base_data(NULL);
> - free_base_data(child);
And still we don't want this universal free.
Thanks for re-running your performance numbers after this change. I didn't
see any significant difference in the relative changes.
I don't think we have a way of measuring "memory pressure" during the
performance test suite. Did you see any evidence that this change has the
intended effect of reducing process memory proactively instead of relying
on the cache evictions?
Thanks,
-Stolee
prev parent reply other threads:[~2026-06-03 12:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-29 16:06 [PATCH] index-pack: retain child bases in delta cache Arijit Banerjee via GitGitGadget
2026-06-01 12:50 ` Derrick Stolee
2026-06-01 16:13 ` [PATCH v2] " Arijit Banerjee via GitGitGadget
2026-06-02 6:45 ` Jeff King
2026-06-03 0:05 ` [PATCH v3] " Arijit Banerjee via GitGitGadget
2026-06-03 12:24 ` Derrick Stolee [this message]
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=c4a32a6f-70bf-4ff4-abbf-d6e301246b5b@gmail.com \
--to=stolee@gmail.com \
--cc=arijit91@gmail.com \
--cc=arijit@effectiveailabs.com \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox