From: Jeff King <peff@peff.net>
To: Mike Hommey <mh@glandium.org>
Cc: git@vger.kernel.org
Subject: Re: Auto-gc in the background can take a long time to be put in the background
Date: Mon, 25 Mar 2019 19:30:07 -0400 [thread overview]
Message-ID: <20190325233007.GA23728@sigill.intra.peff.net> (raw)
In-Reply-To: <20190325232223.r72qtffyzn5qzoxc@glandium.org>
On Tue, Mar 26, 2019 at 08:22:23AM +0900, Mike Hommey wrote:
> Recently, I've noticed that whenever the auto-gc message shows up about
> being spawned in the background, it still takes a while for git to
> return to the shell.
>
> I've finally looked at what it was stuck on, and it's
> `git reflog expire --all` taking more than 30s. I guess the question is
> whether there's a reason this shouldn't run in the background? Another
> is whether there's something that makes this slower than it should be.
The reason is that it takes locks which can interfere with other
operations; see 62aad1849f (gc --auto: do not lock refs in the
background, 2014-05-25).
Unfortunately making it faster is hard. To handle expiring unreachable
items, it has to know what's reachable. Which implies walking the commit
graph. I don't recall offhand whether setting unreachable-expiration to
"never" would skip that part. But if not, that should be low-hanging
fruit.
(I also wonder whether there is really much valuable in keeping
unreachable things for a shorter period of time, and the default should
simply be to just prune everything after 90 days, unreachable or not).
-Peff
next prev parent reply other threads:[~2019-03-25 23:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-25 23:22 Auto-gc in the background can take a long time to be put in the background Mike Hommey
2019-03-25 23:30 ` Jeff King [this message]
2019-03-26 6:50 ` Ævar Arnfjörð Bjarmason
2019-03-26 13:25 ` Jeff King
2019-03-26 13:43 ` Johannes Schindelin
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=20190325233007.GA23728@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=mh@glandium.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 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 NNTP newsgroup(s).