From: Nicholas Piggin <npiggin@gmail.com>
To: Dave Chinner <david@fromorbit.com>
Cc: linux-xfs@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
Dave Chinner <dchinner@redhat.com>,
"Darrick J. Wong" <darrick.wong@oracle.com>
Subject: Re: [rfc] larger batches for crc32c
Date: Fri, 28 Oct 2016 16:02:18 +1100 [thread overview]
Message-ID: <20161028160218.1af40906@roar.ozlabs.ibm.com> (raw)
In-Reply-To: <20161028131234.24a5cb6f@roar.ozlabs.ibm.com>
On Fri, 28 Oct 2016 13:12:34 +1100
Nicholas Piggin <npiggin@gmail.com> wrote:
> On Fri, 28 Oct 2016 08:42:44 +1100
> Dave Chinner <david@fromorbit.com> wrote:
>
> > > I don't know if something like this would be acceptable? It's not pretty,
> > > but I didn't see an easier way.
> >
> > ISTR we made the choice not to do that to avoid potential problems
> > with potential race conditions and bugs (i.e. don't modify anything
> > in objects on read access) but I can't point you at anything
> > specific...
>
> Sounds pretty reasonable, especially for the verifiers. For the paths
> that create/update the checksums (including this log checksum), it seems
> like it should be less controversial.
>
> But yes let me get more data first. Thanks for taking a look.
Okay, the XFS crc sizes indeed don't look too so bad, so it's more the
crc implementation I suppose. I was seeing a lot of small calls to crc,
but as a fraction of the total number of bytes, it's not as significant
as I thought. That said, there is some improvement you may be able to
get even from x86 implementation.
I took an ilog2 histogram of frequency and total bytes going to XFS
checksum, with total, head, and tail lengths. I'll give as percentages
of total for easier comparison (total calls were around 1 million and
500MB of data):
frequency bytes
ilog2 total | head | tail total | head | tail
3 0 1.51 0 0 0.01 0
4 0 0 0 0 0 0
5 0 0 0 0 0 0
6 0 22.35 0 0 1.36 0
7 0 76.10 0 0 14.40 0
8 0 0.04 ~0 0 0.02 ~0
9 22.25 ~0 98.39 13.81 ~0 71.07
10 76.14 0 0 73.77 0 0
11 0 0 0 0 0 0
12 0 0 1.60 0 0 12.39
13 1.60 0 0 12.42 0 0
Keep in mind you have to sum the number of bytes for head and tail to
get ~100%.
Now for x86-64, you need to be at 9-10 (depending on configuration) or
greater to exceed the breakeven point for their fastest implementation.
Split crc implementation will use the fast algorithm for about 85% of
bytes in the best case, 12% at worst. Combined gets there for 85% at
worst, and 100% at best. The slower x86 implementation still uses a
hardware instruction, so it doesn't do too badly.
For powerpc, the breakeven is at 512 + 16 bytes (9ish), but it falls
back to generic implementation for bytes below that. I think we can
reduce the break even point on powerpc slightly and capture most of
the rest, so it's not so bad.
Anyway at least that's a data point to consider. Small improvement is
possible.
Thanks,
Nick
next prev parent reply other threads:[~2016-10-28 5:02 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-27 16:17 [rfc] larger batches for crc32c Nicholas Piggin
2016-10-27 18:29 ` Darrick J. Wong
2016-10-28 3:21 ` Nicholas Piggin
2016-10-27 21:42 ` Dave Chinner
2016-10-27 23:16 ` Dave Chinner
2016-10-28 2:12 ` Nicholas Piggin
2016-10-28 4:29 ` Dave Chinner
2016-10-28 5:02 ` Nicholas Piggin [this message]
2016-10-31 3:08 ` Dave Chinner
2016-11-01 3:39 ` Nicholas Piggin
2016-11-01 5:47 ` Dave Chinner
2016-11-02 2:18 ` [rfe]: finobt option separable from crc option? (was [rfc] larger batches for crc32c) L.A. Walsh
2016-11-03 8:29 ` Dave Chinner
2016-11-03 16:04 ` L.A. Walsh
2016-11-03 18:15 ` Eric Sandeen
2016-11-03 23:00 ` Dave Chinner
2016-11-04 6:56 ` L.A. Walsh
2016-11-04 17:37 ` Eric Sandeen
2016-11-04 0:12 ` [rfc] larger batches for crc32c Dave Chinner
2016-11-04 2:28 ` Nicholas Piggin
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=20161028160218.1af40906@roar.ozlabs.ibm.com \
--to=npiggin@gmail.com \
--cc=darrick.wong@oracle.com \
--cc=david@fromorbit.com \
--cc=dchinner@redhat.com \
--cc=hch@lst.de \
--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).