From: "George Spelvin" <linux@horizon.com>
To: linux@horizon.com, tim.c.chen@linux.intel.com
Cc: david.m.cote@intel.com, herbert@gondor.apana.org.au,
james.guilford@intel.com, JBeulich@suse.com,
linux-kernel@vger.kernel.org, sandyw@twitter.com,
wajdi.k.feghali@intel.com
Subject: Re: [PATCH v2] crypto: crc32c-pclmul - Shrink K_table to 32-bit words
Date: 28 May 2014 19:55:16 -0400 [thread overview]
Message-ID: <20140528235516.13714.qmail@ns.horizon.com> (raw)
In-Reply-To: <1401318135.2970.399.camel@schen9-DESK>
> Can you do a tcrypt speed measurement with and without your changes?
> Check to see if there's any slowdown. Please make sure you pin
> the frequency of your cpu when running the test.
Sure thing; I was already inspired to do that based on your concerns.
Do you have any particular buffer sizes or alignments you'd suggest?
Since I'm changing only the three-part core, I was going to
avoid unaligned or short buffers, stick with a single buffer so
it stays in L1 D-cache, but vary the length so we use lots of
the K_table.
It's not the RAM I was worried about, but the D-cache wasted on
on the K table. Which doesn't affect the CRC code itself, but the
surrounding kernel code.
I'm also thinking of some ideas for handling even larger buffer sizes
without having to interrupt the 3-way main loop. Pclmulqdq can
mutiply up to 4 32-bit values to produce a 128-bit result, which
crc32 can efficiently reduce. So if we have three tables, of
x^(64*n) x^(4096*n), and x^(262144*n), each for n=0..63, we can
multiply them all together to handle up to a 16 MiB chunk.
The other option is to schedule the pclmulqdq in parallel with
the crc32q iterations and, after arranging a staggered start,
have a 4-part main loop, where 3 parts are performing crc32q
iterations and the fourth is using SSE to shift itself
forward (at which point it gets XORed into the data stream
that one other part is working on).
I haven't got all the details of that idea worked out in my head, but
it seems possible. I have to study the optimization guide in detail to
see how many micro-ops the crc32q instruction from memory is (and thus
how much of the decoder it requires).
As of Nehalem, a small inner loop that fits in the decoded uop cache
has the potential to be faster than a hugely unrolled one.
next prev parent reply other threads:[~2014-05-28 23:55 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-28 14:40 [RFC PATCH] crypto: crc32c-pclmul - Use pmovzxdq to shrink K_table George Spelvin
2014-05-28 15:32 ` George Spelvin
2014-05-28 22:15 ` [PATCH v2] crypto: crc32c-pclmul - Shrink K_table to 32-bit words George Spelvin
2014-05-28 23:02 ` Tim Chen
2014-05-28 23:55 ` George Spelvin [this message]
2014-05-29 3:26 ` George Spelvin
2014-05-29 16:33 ` Tim Chen
2014-05-28 20:47 ` [RFC PATCH] crypto: crc32c-pclmul - Use pmovzxdq to shrink K_table Jan Beulich
2014-05-28 21:47 ` George Spelvin
2014-05-29 6:44 ` Jan Beulich
2014-05-28 22:32 ` Tim Chen
2014-05-28 23:01 ` George Spelvin
2014-05-28 23:28 ` Tim Chen
2014-05-29 23:54 ` George Spelvin
2014-05-30 1:07 ` Tim Chen
2014-05-30 1:16 ` Dave Jones
2014-05-30 17:56 ` Tim Chen
2014-05-30 18:45 ` Dirk Brandewie
2014-05-30 19:32 ` Tim Chen
2014-05-30 19:38 ` Dirk Brandewie
2014-05-30 20:07 ` Tim Chen
2014-05-30 20:15 ` Dirk Brandewie
2014-05-30 1:37 ` George Spelvin
2014-05-30 5:25 ` George Spelvin
2014-05-30 16:10 ` Tim Chen
2014-05-30 16:52 ` George Spelvin
2014-05-30 17:01 ` Tim Chen
2014-06-07 3:08 ` [PATCH v3] crypto: crc32c-pclmul - Shrink K_table to 32-bit words George Spelvin
2014-06-20 18:42 ` Herbert Xu
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=20140528235516.13714.qmail@ns.horizon.com \
--to=linux@horizon.com \
--cc=JBeulich@suse.com \
--cc=david.m.cote@intel.com \
--cc=herbert@gondor.apana.org.au \
--cc=james.guilford@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sandyw@twitter.com \
--cc=tim.c.chen@linux.intel.com \
--cc=wajdi.k.feghali@intel.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®