From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=103.168.172.147 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796200722; b=WRInOpknZQ310bGB+URsVyJFI7AIXEPkQYWqDB4SoOpP6TEgmJF4E4PFFFCM5rmbPlee mIoKEROv132I4Fdbm6VGzrMGJgoyZL+PBaXkbTQ245ZoA6kCcOhIKO2YUvfIfLZ8II+0r AJh7H5lkyuA5t0wRmMCJBuLE+/SwhA2khGDmXfC6McWtFEDogd/0G5NTaljnie9dI0NHe UNHuo8UT2ZFgFVIzpEV5LUYLlJ4+cfxjIOHtTK8D3cgsqUzpMvp6Ipuwz8QREm4ex9vsL AD400MNJoUuBKLF6e/Wf5oCxoHQqr+dPLvoJ5sBvUY37rGnBhf2XWu98yZLklG9dhiA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796200722; 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:Received:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=zc/ZZpLzamH68TjZ7vpRsiqG2sT8AMYSChp3eg+Ewoo=; b=qQsNweq7tdisu0KhI/DWCTDZY0uSRvA3C6DlBM8mFaM0d15x3V86D3KwL/JYR19qQhRj 1DVUKNokPhZrONbO6m1LOPevR47/Y985Dsd+2cs7cRa89W1P2rP++PFiJXqvqq4cJxpJt WVbC//PHvZ7yxWGJofw5S6MBGoks/W3sBBcjeZrEFJ62NHnEj7y4ZzEFc8DNlGxxZXms8 bxDDBf8fizHytfQRKD29uSw4PidTUQdvQokgM+oURHfIiyZ1Mvg+yzaoarDg7y3TsFa34 9Pbe2Ayk0E1soYTEXfSNg25VUdcDCQJFeJtxVwvvMy+CjTt+adVOjJvzQoadsr7AADQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass header.d=pks.im header.i=@pks.im header.a=rsa-sha256 header.s=fm3 header.b=g2WgcsCO; dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=iotm72m1; arc=none smtp.remote-ip=103.168.172.147 Received: from fout-a4-smtp.messagingengine.com (fout-a4-smtp.messagingengine.com [103.168.172.147]) (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 B1EC8606A32D for ; Wed, 2 Dec 2026 08:38:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B1EC8606A32D Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=pks.im header.i=@pks.im header.a=rsa-sha256 header.s=fm3 header.b=g2WgcsCO; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=iotm72m1 Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id A568DEC053F for ; Wed, 2 Dec 2026 03:38:40 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Wed, 02 Dec 2026 03:38:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; 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=fm3; t=1796200720; x=1796287120; bh=zc/ZZpLzam H68TjZ7vpRsiqG2sT8AMYSChp3eg+Ewoo=; b=g2WgcsCOxReeAUglVlQaOqKKvu BAiVnQyWFUQVmVnnDSGMCP84wHv0PBGE2AiF6gSTG6NH1cV+QMara81J0kHvUbip ADY9DC2IaSqnHw4nrzwoQPQg2q+L0xnM7kk5RxdD4wg7GL3svVHumVJJOjgHAxea UyyGtGEZAusL3duLU3q0aO8cbkQtGV4SA6oQ7Oc6ONzlIvE1V2Orn5rrl+Q+Md3W zeDEHFDEIQNvk5FUWGBISZ05mHafivYGfrgkmjhMQuT+JykCC6XGc5InYixJKyY1 TFujKcXk4f1mbKIVGY0504irUiIuEeA1M041w68HG/aDG8GnsSLql5BpeJ3Q== 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= 1796200720; x=1796287120; bh=zc/ZZpLzamH68TjZ7vpRsiqG2sT8AMYSChp 3eg+Ewoo=; b=iotm72m1d2svULFHh9Tu9WrgdrN8Bwg2QgtpISFkmcbQl0+fqsp KrT6z958sR9qoEdDozAyBbyHw2B7l0Gchcl0AEAK9TngCDkkI0OcEIfw5Hi7HGGW nRzNqhfSMNe1SpefUrTZcZt+X07ndnL4xUXq9S/3aZWHYLJOu2WLb9szs4Y+tAFp kdF3r0T/Oj/A5aMxo39lrHDPaWihX0AXK+mtrtsMWNw9UhFW2np5vG/g00UFTiLr XvwljhBGMXs94Ly0bJI0taRRw0GMJgZ2YcuPid0ndwDlggUUm7o+BoJ0zGa5YrQv 4tWCHNbEp7ty0CfbwgDxsAFqh0EfFUxdvpw== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=sign d=pks.im a=rsa-sha256; DKIM2-Signature: i=1; m=1; t=1796200720; d=pks.im; mf=PHBzQHBrcy5pbT4=; rt=PGdpdEB2Z2VyLmtlcm5lbC5vcmc+; s=fm3:rsa-sha256:VybzSSIMNBEoQ3z4uEiwq/swnQUlA/TwieJ8V/N64Eicpkk 9rYrxSDCzzOdYdJFPD6fGZybRIgja09EEEO49keEUR5Jtti06khEZvhKormUo+sN q+PmwL9OH8CZkeHLMucct7puvm2O/mJyabTpb0b7P+CosmnLGJE+n9yRz/6YPvU0 m7Y6tjwMbpesHMQWu8vnfnhPir37UzTau0/7F3Brl6kxZrq+DnUdbR/TJtpFeZCP HUtIR0ybc08CK1wrv9/EyU+M3ysTApfm9UN3XSBotZq+vJBzXf04TGslZcGi6N+E uWkXhwiiESpgcxePtqONAHI1saY2WtsiNH7vTVA==; 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-disposition,content-type,date,feedback-id,from, in-reply-to,message-id,mime-version,references,subject,to; Message-Instance: m=1; h=sha256:2hIZJpdeamHECgYmP87DPCAj2l5/KFv7WlDKF1Lku+M=:hpJ5FxYtuYPBNp547fNfGTwwpXYOolYQGnywU3Z7auA=; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTGEGuto8L7jD4W7Bwrygu4nPmzJAw5lcpgW/ICG8DeKOUD8/9m6B49DsSMPBFhz6z OQ+n/DilHKb4x/CkLnKnWNTDUnLjjccDSirgFWpjKQIhzLMfQoC0bRVxUvo/jg+HfVD2mQ QnuAAMF9JN7Bq+Jnxcp0kIgVC4cFWxcwF35yWoZysS6CobIi63gLbGpubtod02jpEXcnJ3 //lvFchhNvdLUHkkOR46hUQDDAg4YiSP86LebDoDwyv0TKko/AGi5e0EDCtqw1r8FjJDP+ cYcKH9To8lKjzROI4FO4rpvX5ftzy2G9EbQigrhXrf1oA2gmguF6fYyqrU35ZrkpsyfHdC jBJU8Dujwyi2OXyp8qYouDL2D4zEPXrRdr6unrBWkCOOZx8OI0kobforg1pbLFbaKgAdv5 TCKGJUdGsnfpWwg256IJdD1+/niQyZM0qw1Erww4GLuCjaPTHC4UdEgQYHE5VkH3fRHg/A IejDgwaqwM7BbbXI3CBFAuQ2gTdy9gIglh3XytUpry46bjeo07VIDp3F5csvnYUfvXVR5T Im7L2D9MMv0fykRDek/76lEw2YWD0rj7mrhgEEKTTrZkIWYOIj8MD+/4OuC1ILHUcwHyPI Xr7Ep+WGbSk5I63jmkkmP5eUesZvIRptIos9zIrrjLaKgGXl1BjsrVTq8czw X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 2 Dec 2026 03:38:39 -0500 (EST) Received: by mail (OpenSMTPD) with ESMTPSA id a8628828 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 2 Dec 2026 08:38:39 +0000 (UTC) Date: Wed, 2 Dec 2026 09:38:37 +0100 From: Patrick Steinhardt To: Junio C Hamano Cc: git@vger.kernel.org Subject: Re: [PATCH 5/6] packfile: maintain process-wide limits globally Message-ID: References: <20261120-pks-packfile-global-statistics-v1-0-19beb83b145f@pks.im> <20261120-pks-packfile-global-statistics-v1-5-19beb83b145f@pks.im> X-Mailing-List: git@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Nov 24, 2026 at 03:24:02PM -0800, Junio C Hamano wrote: > Patrick Steinhardt writes: > > > Our packfile subsystem has two limits that are supposed to apply > > globally across all open packfiles: > > > > - `pack_max_fds` is the maximum number of open file descriptors for > > packfiles. When we exceed that limit, we close least-recently-used > > packs until we're below it again. > > > > - "core.packedGitLimit" is the maximum number of packfile data that > > may be mapped into memory. When we exceed that limit, we close the > > least-recently-used windows into our packfiles. > > I somehow find "maximum number of packfile data" a bit awkward, as > "data" is not something I would count "1 datum, 2 data, ...". Are we > talking about the number of packfiles? No. Perhaps "maximum amount > of" (or "maximum number of bytes of", but that is a mouthful)? I think we can simply swap s/data/bytes/, and that's probably good enough. > > Introduce a global list of all packfiles. This list is completely > > independent of the owning repository or object database, and it is > > agnostic of the actual object database backend that's in use. Use it to > > maintain the above two limits. > > Hmph. On one hand we are talking about flexible object store that may > not even have the concept of "packfile", yet here we assume no matter > what kind of pluggable object store is in use, there is some concept of > "packfile" that occupies a large portion of the address space and may > need to be evicted to reduce address space pressure. > > I smell some impedance mismatch but I cannot think of a way to rectify > it. There's two scenarios here: - The backend doesn't use packfiles at all. As the list of packfiles is only maintained when using packfiles we don't care about this scenario, as the list will simply be unused in that case. - The backend does use packfiles, but it's not the "files" backend. In this case we do want to maintain the global limit of packfiles regardless of the backend itself. This patch here ignores the first item, because there isn't really anything we need to do about it in the first place. But it addresses the second item because now we're starting to become independent of the actual backend that's in use, as we treat packfiles the same regardless of the backend and enforce the limits globally. So this patch actually fixes this mismatch, because... > > diff --git a/packfile.c b/packfile.c > > index 077b0395a79..0d5647c74c8 100644 > > --- a/packfile.c > > +++ b/packfile.c > > @@ -195,6 +196,7 @@ static struct packed_git *packfile_new(struct repository *r, int extra) > > memset(p, 0, sizeof(*p)); > > p->pack_fd = -1; > > p->repo = r; > > + packfile_list_append(&all_packfiles, p, 1); > > return p; > > } > > > > Tracking all packs allocated via packfile_new() in a global list and > removing them in packfile_free() cleanly solves both the cross-repo > limit problem and the unconditional odb_source_files_downcast() calls in > unuse_one_window() and close_one_pack(). ... we lose the downcast here. Patrick