From: Dave Chinner <david@fromorbit.com>
To: Brian Foster <bfoster@redhat.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH] xfs: speed up directory bestfree block scanning
Date: Thu, 4 Jan 2018 07:38:54 +1100 [thread overview]
Message-ID: <20180103203854.GM5858@dastard> (raw)
In-Reply-To: <20180103132802.GA17932@bfoster.bfoster>
On Wed, Jan 03, 2018 at 08:28:03AM -0500, Brian Foster wrote:
> On Wed, Jan 03, 2018 at 05:27:48PM +1100, Dave Chinner wrote:
> > + if (be16_to_cpu(bests[findex]) != NULLDATAOFF &&
> > + be16_to_cpu(bests[findex]) >= length) {
> > + dbno = freehdr.firstdb + findex;
> > + break;
> > }
> > + } while (++findex < freehdr.nvalid);
> > +
> > + /* Drop the block if we done with the freeblock */
>
> "... if we're done ..."
>
> Also FWIW, according to the comment it looks like the only reason the
> freehdr conversion is elevated to this scope is to accommodate gcc
> foolishness. If so, I'm wondering if a simple NULL init of bests at the
> top of the function would avoid that problem and allow us to move the
> code to where it was apparently intended to be in the first place. Hm?
Yeah, looking at the follow-on patch, there's a gigantic amount of
cleanup needed in this function. There's a bunch of "gcc is so
stupid" hacks amongst the code because the function is too long
for gcc correctly determine variable usage.
I might sit down and factor it properly because that will make it a
whole lot simpler and easier to understand...
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
prev parent reply other threads:[~2018-01-03 20:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-03 6:27 [PATCH] xfs: speed up directory bestfree block scanning Dave Chinner
2018-01-03 11:59 ` Dave Chinner
2018-01-03 13:41 ` Brian Foster
2018-01-03 21:00 ` Dave Chinner
2018-01-04 14:04 ` Brian Foster
2018-01-04 21:52 ` Dave Chinner
2018-01-03 13:28 ` Brian Foster
2018-01-03 20:38 ` Dave Chinner [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180103203854.GM5858@dastard \
--to=david@fromorbit.com \
--cc=bfoster@redhat.com \
--cc=linux-xfs@vger.kernel.org \
/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.
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 NNTP newsgroup(s).