From: Jeff King <peff@peff.net>
To: Gargi Sharma <gs051095@gmail.com>
Cc: git@vger.kernel.org, olyatelezhnaya@gmail.com
Subject: Re: [PATCH] mru: Replace mru.[ch] with list.h implementation
Date: Sun, 12 Nov 2017 09:59:10 +0000 [thread overview]
Message-ID: <20171112095910.xwz43bzfbr5hz3tq@sigill.intra.peff.net> (raw)
In-Reply-To: <20171112095435.f4o662ygtt2taf5y@sigill.intra.peff.net>
On Sun, Nov 12, 2017 at 09:54:35AM +0000, Jeff King wrote:
> > @@ -1566,6 +1566,7 @@ struct pack_window {
> >
> > extern struct packed_git {
> > struct packed_git *next;
> > + struct list_head mru;
> > struct pack_window *windows;
> > off_t pack_size;
> > const void *index_data;
>
> Sort of a side note, but seeing these two list pointers together makes
> me wonder what we should do with the list created by the "next" pointer.
> It seems like there are three options:
>
> 1. Convert it to "struct list_head", too, for consistency.
>
> 2. Leave it as-is. We never delete from the list nor do any fancy
> manipulation, so it doesn't benefit from the reusable code.
>
> 3. I wonder if we could drop it entirely, and just keep a single list
> of packs, ordered by mru. I'm not sure if anybody actually cares
> about accessing them in the "original" order. That order is
> reverse-chronological (by prepare_packed_git()), but I think that
> was mostly out of a sense that recent packs would be accessed more
> than older ones (but having a real mru strategy replaces that
> anyway).
>
> What do you think?
Thinking on this a bit more, even if we want to go down any road except
(2), it probably ought to come as a separate patch on top anyway. The
changes you're making here are quite obviously a noop for visible
behavior.
But dropping the "next" pointer (and the matching "don't clear the list"
I mentioned later) would potentially mean examining the packs in a
slightly different order. I _think_ that's fine, but it's possible there
could be a subtle fallout. So it's better to keep it separate from the
more pure refactoring in your patch.
-Peff
next prev parent reply other threads:[~2017-11-12 9:59 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-11 18:06 [PATCH] mru: Replace mru.[ch] with list.h implementation Gargi Sharma
2017-11-12 9:54 ` Jeff King
2017-11-12 9:59 ` Jeff King [this message]
2017-11-12 12:49 ` Gargi Sharma
2017-11-12 16:16 ` Jeff King
2017-12-12 14:07 ` Оля Тележная
-- strict thread matches above, loose matches on Subject: below --
2018-01-16 1:46 Gargi Sharma
2018-01-19 18:26 ` Christian Couder
2018-01-19 21:01 ` Junio C Hamano
2018-01-19 21:46 ` Jeff King
2018-01-19 23:39 ` Gargi Sharma
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=20171112095910.xwz43bzfbr5hz3tq@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gs051095@gmail.com \
--cc=olyatelezhnaya@gmail.com \
/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).