git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: David Emett <dave@sp4m.net>
Cc: git@vger.kernel.org
Subject: Re: Two issues with mark_reachable_objects
Date: Tue, 27 Apr 2021 11:13:38 -0400	[thread overview]
Message-ID: <YIgqIiCeiTISIio1@coredump.intra.peff.net> (raw)
In-Reply-To: <YIgijn93f639Pp7Z@coredump.intra.peff.net>

On Tue, Apr 27, 2021 at 10:41:18AM -0400, Jeff King wrote:

> I think we'd just want to run the whole mark_recent block after doing
> the bitmap traversal.
> 
> There may be some subtlety with reusing the rev_info struct again. I
> think we'd want to reset the pending objects list after calling into the
> bitmap code. It _usually_ does an actual traversal that consumes the
> list, but not necessarily. I think traverse_bitmap_commit_list()
> probably ought to be the one to do it, so it behaves more like
> traverse_commit_list(). (OTOH, I don't think it's _too_ bad if we don't;
> we'd include those already-seen objects in our traversal, but they
> should all by definition have the SEEN bit set, so we'd stop there).

Nope, I was wrong here. It's actually prepare_bitmap_walk() which would
want to clear the pending list, and it does so (it may later re-add
objects in find_objects(), but if it does so, it will definitely
traverse and consume them).

> It's possible that we could do the second mark_recent traversal also
> with bitmaps (but still separately). I can't offhand think of a reason
> that ignore_missing_links wouldn't behave well there. But since we
> expect it to be small, I'd be more comfortable just using the regular
> traversal code.

I poked at this a bit, and indeed, the bitmap code is not ready to
handle the caller passing ignore_missing_links (it performs two separate
traversals for the wanted and uninteresting objects, and manipulates
ignore_missing_links itself between the two). It would probably be easy
to change, but I think we should focus on the minimal fix for the bug
you found first.

-Peff

  reply	other threads:[~2021-04-27 15:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-27 10:45 David Emett
2021-04-27 14:41 ` Jeff King
2021-04-27 15:13   ` Jeff King [this message]
2021-04-27 15:43 ` [PATCH] prune: save reachable-from-recent objects with bitmaps Jeff King
2021-04-28 12:20   ` David Emett
2021-04-28 15:13     ` Jeff King
2021-04-28 15:41       ` [PATCH v2 0/2] " Jeff King
2021-04-28 15:42         ` [PATCH v2 1/2] pack-bitmap: clean up include_check after use Jeff King
2021-04-28 15:42         ` [PATCH v2 2/2] prune: save reachable-from-recent objects with bitmaps Jeff King
2021-04-29  1:37           ` Junio C Hamano

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YIgqIiCeiTISIio1@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=dave@sp4m.net \
    --cc=git@vger.kernel.org \
    --subject='Re: Two issues with mark_reachable_objects' \
    /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

Code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).