🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.git
Article #3738

Re: [PATCH 6/6] packfile: skip closing packs marked as do-not-close

#3738
From: Junio C Hamano
Date: Tue, 24 Nov 2026 21:14
38 lines
14000 bytes
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);
>  	}
Technical Details
Message-ID: <xmqqo6belyp1.fsf@gitster.g>
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!git+bounces-76260-linux-kernel-git=dewy.ru
References: <20261120-pks-packfile-global-statistics-v1-0-19beb83b145f@pks.im> <20261120-pks-packfile-global-statistics-v1-6-19beb83b145f@pks.im>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!git+bounces-76260-linux-kernel-git=dewy.ru
From: gitster@pobox.com (Junio C Hamano)
Newsgroups: linux.kernel.git
Subject: Re: [PATCH 6/6] packfile: skip closing packs marked as do-not-close
Date: Tue, 24 Nov 2026 13:14:02 -0800
Organization: Usenet Network
Message-ID: <xmqqo6belyp1.fsf@gitster.g>
References: <20261120-pks-packfile-global-statistics-v1-0-19beb83b145f@pks.im>
	<20261120-pks-packfile-global-statistics-v1-6-19beb83b145f@pks.im>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: usenet.network;
	logging-data="40272"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:2QdBEu9bxaoR+MFh+GqKVexo6zE= sha256:gbN5ww3pu1Q6KKlwJj/ciQgGIa6+4MLDmKljntpHpvw=
	sha1:dUcc0nM9Tqs0bvPAeLt+29TyC8U= sha256:yyrraAEa+/1sO9PYwppBVyxVZAvilKMOkvr7HXnuEg0=
List-ID: <git.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 775C0125E32; Wed, 25 Nov 2026 00:14:27 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.05
X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=pobox.com header.b=T/ae4mP6; dkim=pass (2048-bit key)
	header.d=messagingengine.com header.b=WXt8614j
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id jjP8eZwVTG50;
	Wed, 25 Nov 2026 00:14:23 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=git+bounces-76260-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=pobox.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 9E0A1125D85; Wed, 25 Nov 2026 00:14:09 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 339953CE28; Tue, 24 Nov 2026 21:14:06 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1795554846;
	b=iM0sPdAEpmYwfJ769+YirP4IRS1vXgpZlQYQvZXYAkV8+4l5AyPmi9d+jscKhVpmwwCw
	 tkTJMQeaO0/ByM5hg+PDG89detH8sEQkoXuQtr5LzAlbyd1+S3QKqWnXjOZ1fs3ylURru
	 HCoWXDluESW1jHTgGJCis/AjwRAqcsaN7JqXxc9K3udI9uXOiIGxo6Y1gj4ox2iKrj7rl
	 hu+SdX+xkTA/f4E/tc1mUpepPiUXjpdyq1SbQi7E7Yh6t6vh+hV9BJnF+r+lSCOajl1yz
	 9PhvovICg+opnVEwCpzPqOzyMR7MhycT0tc8b594qZNbvjWd5FajikUXccpdrp9V7HQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795554846;
	h=X-Original-To:Received:DMARC-Filter:Received:Received:DKIM-Signature:
	 DKIM-Signature:X-DKIM2-Info:DKIM2-Signature:X-DKIM2-Info:
	 Message-Instance:X-ME-Sender:X-ME-Received:X-ME-Proxy-Cause:
	 X-ME-Proxy:Feedback-ID:Received:From:To:Cc:Subject:In-Reply-To:
	 References:Date:Message-ID:User-Agent:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version:Content-Type;
	bh=XHm6ottBQNZad6tIR6LCwGVC0qhXk5wrOqNLzHUXv4g=;
	b=QHHC2JJB1GZ/QBgfpSEIe80eMtzlO5WsuB3Jv3gM22aGLYNHExQ35G73OBDjaVhVBJpm
	 eedSnz+w/vT1Ku4hi8e7ooOaDeKHgylc86Lpb0D8JjKvaGV0dqYCgOyy5miS4BfIbTj2/
	 ByncY4961aL7z9ud6km0UwTRH7uGw0wbk9c5qTP0CnSYVYonakR5QADoJXNreNsEGI2X5
	 SowVPlVkooI8hVlQ3dxApTpv1O7ML1QH2xlLMBDyh9VJTt9Zd7Px0p0HSEBM0jloLduYf
	 zUI6DEWNVawAkSerYDyf0OFNBLfNADWjXPHKv+S3WZ4UY8VxvwCYfjVKtvCw0IBfncA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=pobox.com header.i=@pobox.com header.a=rsa-sha256 header.s=fm2 header.b="T/ae4mP6";
	dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=WXt8614j;
	dmarc=pass header.from=pobox.com;
	spf=pass smtp.mailfrom=pobox.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 0B64B606A32A;
	Tue, 24 Nov 2026 21:14:06 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=pobox.com header.i=@pobox.com header.a=rsa-sha256 header.s=fm2 header.b=T/ae4mP6;
	dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=WXt8614j
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=103.168.172.158
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795554845;
	b=lpgzu+hjrJ6yF+fdqFfpliYtsRNZUOX+SW2TayZiADUPi34qVtm1IhwhrQ4CuRmZYtkV
	 DyQmgB7AsBPgMlPcr8EVptYvBhqcPL8ekhssPqwWvmtYpzcm8QrTgiBzzq++sG8O9jLW2
	 /WeJOJbHWNq6fDmH0wB+UDk/dp1sFry/nSN4hrHJq9rIw2KUGc5msW+azCChhXrtt1C01
	 0ysfDDDMEtB6axL0Xf/QNKJG1NeKD464ud0fTQ7rH+jKrivDbYhdueAb2WcUogYYovlGC
	 166QloPUtKpc4rg8ECnU6t10U7KHwcmMZ57l/hT1VUrSJhx2MU436JILgYxSOnJdJdA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795554845;
	h=DMARC-Filter:Received:Received:DKIM-Signature:DKIM-Signature:
	 X-DKIM2-Info:DKIM2-Signature:X-DKIM2-Info:Message-Instance:
	 X-ME-Sender:X-ME-Received:X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID:
	 Received:From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID:
	 User-Agent:MIME-Version:Content-Type;
	bh=XHm6ottBQNZad6tIR6LCwGVC0qhXk5wrOqNLzHUXv4g=;
	b=PxPNtpYhe5c9DZ18OI2BmH9Ti3fRVWOOYEp3pviLwrbh+kA6OnKDsWogQ1bR3wNfaLhS
	 tElKllFvwih86Cta1uIqRsI1G2nL0/aOzF7H5ZMed5RLFSvDbhHfMrgmc+EKZ+i1Fsjjd
	 xYpg89F8LwjNKUdg3MYFRN7yEuoI/Ghfehdnyx7/OMf3WMV7I6O84uYC/TSWGdVxl5EgK
	 D4xWLmEAaMA0yYuzT7rzG3FLj9lWCHri5nRcvdBLka8QSU/NhQiqh7v8iQh/sBefOMM+D
	 zdtsSgN125m6O6boKEKk+70gaz6xUOl0RDfFUYj41aEfc4YtRKdacDFx7pzCsZjn42Q==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=pobox.com;
	spf=pass smtp.mailfrom=pobox.com;
	dkim=pass header.d=pobox.com header.i=@pobox.com header.a=rsa-sha256 header.s=fm2 header.b="T/ae4mP6";
	dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=WXt8614j;
	arc=none smtp.remote-ip=103.168.172.158
X-Received: from fhigh-a7-smtp.messagingengine.com (fhigh-a7-smtp.messagingengine.com [103.168.172.158])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id BDF00606A31E
	for <git@vger.kernel.org>; Tue, 24 Nov 2026 21:14:04 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BDF00606A31E
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pobox.com
X-Received: from phl-compute-08.internal (phl-compute-08.internal [10.202.2.48])
	by mailfhigh.phl.internal (Postfix) with ESMTP id E4907140032C
	for <git@vger.kernel.org>; Tue, 24 Nov 2026 16:14:03 -0500 (EST)
X-Received: from phl-frontend-02 ([10.202.2.161])
  by phl-compute-08.internal (MEProxy); Tue, 24 Nov 2026 16:14:03 -0500
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pobox.com; h=cc
	:cc:content-type:content-type:date:date:from:from:in-reply-to
	:in-reply-to:message-id:mime-version:references:reply-to:subject
	:subject:to:to; s=fm2; t=1795554843; x=1795641243; bh=XHm6ottBQN
	Zad6tIR6LCwGVC0qhXk5wrOqNLzHUXv4g=; b=T/ae4mP608BA6Q8EHLvRr0/7qC
	7DegBg9POyDTRFTaunDraJUwNiAU5vDVJpnFSW9gMisREwUyljUZ+qHI6GsiCTFP
	WmUnnPZheKfVY+CzA/m718cQz8aldGSu+V3nAd/8ggt/ydLrOtd3S74AjbrIlOIo
	NppTz2MWXrk4BiP0ijCXUM5+koxMSC5mtSyJ7qgLnIOP3MMtnt74qC0XWMm+6Afn
	UIUnWjiDVJaLXcfgrFI9TkUtqbiBxmHkame1JOC8FyKWu0faloWOu1ebZ8TMOduU
	abvr3lhYG2+tntVgCYo8PhwwxKiI0Q1AINwuL4ISr+B4ybsoxZErbadqX9GA==
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-type:content-type:date:date
	:feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
	:message-id:mime-version:references:reply-to:subject:subject:to
	:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=
	1795554843; x=1795641243; bh=XHm6ottBQNZad6tIR6LCwGVC0qhXk5wrOqN
	LzHUXv4g=; b=WXt8614jQ7rcl+y3RYgWnQwCwkO3KQvSmN2oFMVcQ0ugrKstMKb
	NLrQ6x5t/DCoCXy6F/Nsx76LiVytJ4JwVTcBJq65Dm80INdZ5HO9k1xKg7EKbysx
	j0T5U6Yq5cxxRo7zt1qAqMXIT3w5VNwGyqhvqk0V+E6By90pTMOCK48e1Z0bWdAD
	azXvMq4EXSUk9tcaU3t/o2BZIB2w2/y08N1fuA2oLHawl+hYKEhjLYOriTrEMLu2
	rGWI+/8raQ3DfJGO0i0u7883CQ2GPBd2bQ+a0x864QLMwOxFgH1FxvfR3jz6Y3UQ
	JUoPHlSt8IGpV0u3NenZHjRwfiNmTD91jKg==
X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09;
	repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox;
	action=sign d=pobox.com a=rsa-sha256;
X-DKIM2-Signature: i=1; m=1; t=1795554843; d=pobox.com;
	mf=PGdpdHN0ZXJAcG9ib3guY29tPg==;
	rt=PGdpdEB2Z2VyLmtlcm5lbC5vcmc+;
	s=fm2:rsa-sha256:R93F/HB9WgS2wFVI/Mzu0bhBHpy2CVRykkqeFfY+Uizzt5H
	jQQqnI9BIr0IzXZiM0xa2UX+u6nz2HABZa15OXGEyK9UqcIRjVFnOrbj52P0898/
	n5AmuZFkpL4tNSU8vfkNQ01VMJ61PSWOwsMf3XX+CepxnqWJ7XEU7SFHGaPVIrke
	NajTNg0CM5OPWVWNEaaVCi2Ns+5G0MUGP7CMHaflio6qo6rqW4NOG3aUojetF1p/
	j3J1FtqoerT2KX5bBYz4Rluhx6klN+Rh7hrFxWt9TXfF1qnVyXdLY53tJX7Jf8ZV
	20PETybJ0+FLO+3vQ6C+WlEOfIUxoEke46ICyzQ==;
X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09;
	repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox;
	action=mi-m=1; hc=12;
	hn=cc,content-type,date,feedback-id,from,in-reply-to,message-id,
	mime-version,references,subject,to,user-agent;
X-Message-Instance: m=1; h=sha256:xfZCIc1zrgVRzcAH5+mHCrd+67PuRXj5+VAN6b5P8e4=:EMn8bz6wbpCpi2NusciG72AnMMVZedyAe7jiXxh2Y7w=;
X-ME-Sender: <xms:G_4Fa1wTnz0kb-OR1JHKhXb0SImhj0FjpodnOuxM6n4cgksSxox5eA>
    <xme:G_4Fa8vdwXoPDESNl_qsAm6wMDLG7-Urfowq-i0l6KoXmi8QO0naRYAGrbrOiTXdz
    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IL0zd9fVVAyliLnpBEqjtAQ>
    <xmx:G_4Fa62_QO5VqrvGLP_JUcf2I50Qh04mOfRK-nHZnXfc4Q0fp0yBSg>
    <xmx:G_4Fa00NLyhtVdz5g0pSK_mWIdEm4w_Q9jJCQglW7O9D1phCzjQvF9-_>
X-Feedback-ID: if26b431b:Fastmail
X-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue,
 24 Nov 2026 16:14:03 -0500 (EST)
X-Cc: git@vger.kernel.org
X-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")
X-User-Agent: Gnus/5.13 (Gnus v5.13)
X-Mailing-List: git@vger.kernel.org
X-List-Post: <mailto:git@vger.kernel.org>
X-List-Help: <mailto:git+help@vger.kernel.org>
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:git+owner@vger.kernel.org>
X-Precedence: list