All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 6/6] packfile: skip closing packs marked as do-not-close
Date: Tue, 24 Nov 2026 13:14:02 -0800	[thread overview]
Message-ID: <xmqqo6belyp1.fsf@gitster.g> (raw)
In-Reply-To: <20261120-pks-packfile-global-statistics-v1-6-19beb83b145f@pks.im> (Patrick Steinhardt's message of "Fri, 20 Nov 2026 13:02:33 +0100")

Patrick Steinhardt <ps@pks.im> writes:

> When closing a packfile to maintain the maximum number of open packs we
> completely ignore the `do_not_close` bit. That bit is only set by
> git-fast-import(1), and as that command allocates its packs manually it
> wouldn't add those packs to the list of all packfiles, and consequently
> we won't ever try to close such a packfile via `close_one_pack()`. But
> that feels like coincidence rather than proper design, and the result is
> rather fragile.
>
> Skip over packfiles marked as do-not-close to reduce the fragility. This
> should not result in a user-visible change in behaviour.

Hmph.  If the only user of the bit does not care that this codepath does
not honor the bit, perhaps a simpler alternative is to retire the bit
that nobody else uses?  Or am I reading the above analysis incorrectly?


> Signed-off-by: Patrick Steinhardt <ps@pks.im>
> ---
>  packfile.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/packfile.c b/packfile.c
> index 0d5647c74c8..86ef3a79d9c 100644
> --- a/packfile.c
> +++ b/packfile.c
> @@ -414,7 +414,8 @@ static int close_one_pack(void)
>  	int accept_windows_inuse = 1;
>  
>  	for (e = all_packfiles.head; e; e = e->next) {
> -		if (e->pack->pack_fd == -1)
> +		if (e->pack->pack_fd == -1 ||
> +		    e->pack->do_not_close)
>  			continue;
>  		find_lru_pack(e->pack, &lru_p, &mru_w, &accept_windows_inuse);
>  	}

  reply	other threads:[~2026-11-24 21:14 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 12:02 [PATCH 0/6] packfile: some lifecycle improvements Patrick Steinhardt
2026-11-20 12:02 ` [PATCH 1/6] builtin/fast-import: stop reporting packfile statistics Patrick Steinhardt
2026-11-24 20:43   ` Junio C Hamano
2026-11-24 22:19   ` brian m. carlson
2026-11-26 14:15   ` Toon Claes
2026-11-20 12:02 ` [PATCH 2/6] packfile: rename lifecycle functions Patrick Steinhardt
2026-11-24 23:47   ` Junio C Hamano
2026-11-26 14:16   ` Toon Claes
2026-11-20 12:02 ` [PATCH 3/6] packfile: inline `open_packed_git_1()` Patrick Steinhardt
2026-11-24 22:04   ` Junio C Hamano
2026-11-26 14:16     ` Toon Claes
2026-11-26 14:16   ` Toon Claes
2026-11-26 20:39     ` Junio C Hamano
2026-11-20 12:02 ` [PATCH 4/6] packfile: introduce function to free a packfile Patrick Steinhardt
2026-11-24 21:34   ` Junio C Hamano
2026-11-26 14:13     ` Toon Claes
2026-11-26 20:41       ` Junio C Hamano
2026-11-20 12:02 ` [PATCH 5/6] packfile: maintain process-wide limits globally Patrick Steinhardt
2026-11-24 23:24   ` Junio C Hamano
2026-11-26 15:11   ` Toon Claes
2026-11-20 12:02 ` [PATCH 6/6] packfile: skip closing packs marked as do-not-close Patrick Steinhardt
2026-11-24 21:14   ` Junio C Hamano [this message]
2026-11-26 15:26     ` Toon Claes
2026-11-26 19:56       ` Junio C Hamano
2026-11-26 15:29 ` [PATCH 0/6] packfile: some lifecycle improvements Toon Claes

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=xmqqo6belyp1.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=ps@pks.im \
    /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.