git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/3] revision: avoid leaking bloom keyvecs with multiple traversals

From
Patrick Steinhardt <ps@pks.im>
Date
Jul 1, 2026, 08:26 UTC
Message-ID
<akTPQ1IVqWy8WTk8@pks.im>
In-Reply-To
<20260701064052.GB2580331@coredump.intra.peff.net>

On Wed, Jul 01, 2026 at 02:40:52AM -0400, Jeff King wrote: [snip]

> There's an alternative fix, which is that prepare_to_use_bloom_filter()
> could notice that we already have keyvec entries and just reuse them.
> But this is less safe; the keyvec depends on the pruning pathspec, and
> we don't know if that has changed.

Right. We could of course start to record the pruning pathspec so that we're able to tell these cases apart, and if so we could reuse the bloom keyvec entries safely. But as you mention...

Show 7 quoted lines
> I think it would _probably_ work in practice, since any caller using a
> rev_info for multiple traversals is probably doing so with the same
> pathspec. But it would also create a very subtle bug if that assumption
> is violated. So we'll do the safer thing here, and generate fresh keyvec
> entries for each traversal. The efficiency difference is probably not
> noticeable, and this is what was happening already (we just weren't
> bothering to free the old ones!).

... we haven't been doing that beforehand, either, so it's fine to not care about that for now and just plug the memory leak.

Patrick
Previous: Jeff KingNext: Derrick Stolee
Message 6 of 11 in “bloom-related leak fixes”
  1. 0/3 bloom-related leak fixesJeff King, Jul 1, 2026
  2. 1/3 bloom: make bloom-filter slab initialization idempotentJeff King, Jul 1, 2026
  3. Derrick StoleeJul 1, 2026
  4. Junio C HamanoJul 1, 2026
  5. 2/3 revision: avoid leaking bloom keyvecs with multiple traversalsJeff King, Jul 1, 2026
  6. Patrick SteinhardtJul 1, 2026
  7. Derrick StoleeJul 1, 2026
  8. Junio C HamanoJul 1, 2026
  9. 3/3 line-log: drop extra copy of range with bloom filtersJeff King, Jul 1, 2026
  10. Derrick StoleeJul 1, 2026
  11. Junio C HamanoJul 1, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.