From: Daniel Borkmann <dborkman@redhat.com>
To: George Spelvin <linux@horizon.com>
Cc: akpm@linux-foundation.org, davem@davemloft.net,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] lib: crc32: Greatly shrink CRC combining code
Date: Wed, 04 Jun 2014 23:07:25 +0200 [thread overview]
Message-ID: <538F8A8D.9090009@redhat.com> (raw)
In-Reply-To: <20140604183244.30105.qmail@ns.horizon.com>
On 06/04/2014 08:32 PM, George Spelvin wrote:
> Thanks for the nitpicks!
>
>> I think you might want to cc Andrew Morton <akpm@linux-foundation.org>
>> to let this go via akpm's tree for misc changes, perhaps?
>
> I don't care, but akpm is fine by me. I'll send out a v2 after I resolve
> one minor point with you; see below.
>
> Once that's done, may I add a Reviewed-by: or Acked-by: line from you?
Yes, feel free to add my Reviewed-by tag and keep me in Cc.
>> Looks good to me! Do you have any performance numbers to share?
>
> Actually, I didn't bother benchmarking it because the improvement was
> so obvious, but here's a quick test showing a 35.5x performance gain.
That's great!
...
>>> -extern u32 crc32_le_combine(u32 crc1, u32 crc2, size_t len2);
>>> +u32 crc32_le_shift(u32 crc, size_t len) __attribute_const__;
>
>> Perhaps a newline here.
>
> Question: where do you think a newline should go? It's not obvious
> to me. My style has been to keep as much of a declaration on one line
> as possible so "git grep <function> include" is as informative as possible.
It's just nit, but since you've asked, end result like this:
--snip--
u32 crc32_le_shift(u32 crc, size_t len) __attribute_const__;
static inline u32 crc32_le_combine(u32 crc1, u32 crc2, size_t len2)
{
return crc32_le_shift(crc1, len2) ^ crc2;
}
--snap--
> Now that I've gotten an ack, I'm happy to be more aggressive about
> tweaking comments. I just wanted to focus the diff on the code changes.
Sounds good, thanks!
>>> +/**
>>> + * crc32_generic_shift - Append len 0 bytes to crc, in logarithmic time
>>> + * @crc: The original little-endian CRC (i.e. lsbit is x^31 coefficient)
>>> + * @len: The number of bytes. @crc is multiplied by x^(8*@len)
>>> + # @polynomial: The modulus used to reduce the result to 32 bits.
>
>> ^^ seems this should have been a '*'
>
> Yes, obviously. Thanks for catching that.
>
>>> +static u32 __attribute_const__ crc32_generic_shift(u32 crc, size_t len,
>>> + u32 polynomial)
>
>> u32 polynomial is not correctly aligned to the opening '(' from the previous line.
>
> Thanks again.
next prev parent reply other threads:[~2014-06-04 21:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-30 5:35 [PATCH 1/3] lib: crc32: Greatly shrink CRC combining code George Spelvin
2014-05-30 5:39 ` [PATCH 2/3] lib: crc32: mark test data __initconst George Spelvin
2014-05-30 5:41 ` [PATCH 3/3] lib: crc32: Add some additional __pure annotations George Spelvin
2014-06-04 12:46 ` [PATCH 1/3] lib: crc32: Greatly shrink CRC combining code Daniel Borkmann
2014-06-04 18:32 ` George Spelvin
2014-06-04 21:07 ` Daniel Borkmann [this message]
2014-06-04 23:12 ` George Spelvin
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=538F8A8D.9090009@redhat.com \
--to=dborkman@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@horizon.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