git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Taylor Blau <me@ttaylorr.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, peff@peff.net
Subject: Re: [PATCH 4/5] builtin/repack.c: be more conservative with unsigned overflows
Date: Fri, 5 Mar 2021 14:41:02 -0500	[thread overview]
Message-ID: <YEKJTmbdZqdMx2j0@nand.local> (raw)
In-Reply-To: <xmqqr1kt9z12.fsf@gitster.c.googlers.com>

On Fri, Mar 05, 2021 at 11:32:57AM -0800, Junio C Hamano wrote:
> > Suggested-by: Junio C Hamano <gitster@pobox.com>
>
> I do not deserve this for my idle thinking-out-aloud speculation.
> You did all the thinking and work.

You're selling yourself short ;-).

> I do not offhand know what a sensible and gentler fallback position
> would be for the factor multiplication, but presumably, if the right
> hand side of this ...
>
> >  		if (geometry_pack_weight(ours) < factor * total_size) {
>
> ... overflows, we can say it would definitely be larger than our
> weight and continue, instead of "no, we cannot multiply total with
> factor, as that would give us too big a number", I guess.

To answer your question about whether or not dying is sensible, I think
that there are a couple of options. You could say, "I can no longer
multiply total_size by factor without overflowing, so I'm not even going
to bother considering additional packs". I guess that makes some
progress in condensing packs, but that's as good as it would get, since
the subsequent repack would also overflow instead of making further
progress, so it would just get stuck.

Which makes me think that the other option, dying, is more sensible. But
I think that this is all a moot point as you seem to indicate anyway,
because having a large enough pack that we are verging on overflowing is
likely not a real-world problem that we are going to deal with (at least
right away).

> I am OK to either (1) leave the code as-is without this patch, because
> the overflow would only affect the largest of packs and would be rare,
> and people who would notice when they hit it would probably are the ones
> with enough resource to diagnose, report and even give us a fix ;-)
> or (2) apply this patch as-is, because the only people who will see
> the die() would be the same ones affected by (1) above anyway.
>
> And applying this patch as-is would give better chance than (1) for
> the overflow to be noticed.
>
> So, let's queue the patch as-is.

Great, I'm fine with that. Thanks.

> Thanks.

Taylor

  reply	other threads:[~2021-03-05 19:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-05 15:21 [PATCH 0/5] clean-ups to geometric repacking Taylor Blau
2021-03-05 15:21 ` [PATCH 1/5] builtin/repack.c: do not repack single packs with --geometric Taylor Blau
2021-03-05 19:15   ` Junio C Hamano
2021-03-05 19:27     ` Taylor Blau
2021-03-05 19:30       ` Taylor Blau
2021-03-05 15:21 ` [PATCH 2/5] t7703: test --geometric repack with loose objects Taylor Blau
2021-03-05 15:21 ` [PATCH 3/5] builtin/repack.c: assign pack split later Taylor Blau
2021-03-05 15:21 ` [PATCH 4/5] builtin/repack.c: be more conservative with unsigned overflows Taylor Blau
2021-03-05 19:32   ` Junio C Hamano
2021-03-05 19:41     ` Taylor Blau [this message]
2021-03-10 21:00   ` Jeff King
2021-03-05 15:22 ` [PATCH 5/5] builtin/repack.c: reword comment around pack-objects flags Taylor Blau

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=YEKJTmbdZqdMx2j0@nand.local \
    --to=me@ttaylorr.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /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.
Code repositories for project(s) associated with this public 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).