From: Sheng Mao <shngmao@gmail.com>
To: dsterba@suse.cz, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs-progs: align btrfs receive buffer to enable fast CRC
Date: Thu, 7 Jan 2021 18:58:04 -0700 [thread overview]
Message-ID: <20210108015804.GA3423@hosting.home> (raw)
In-Reply-To: <20210106121635.GR6430@twin.jikos.cz>
Alignment to cache line is a great idea. I guess compiler can issue
faster memcpy version.
Thank you!
On Wed, Jan 06, 2021 at 01:16:35PM +0100, David Sterba wrote:
>
> On Sat, Dec 26, 2020 at 02:46:06PM -0700, shngmao@gmail.com wrote:
> > From: Sheng Mao <shngmao@gmail.com>
> >
> > To use optimized CRC implemention, the input buffer must be
> > unsigned long aligned. btrfs receive calculates checksum based on
> > read_buf, including btrfs_cmd_header (with zero-ed CRC field)
> > and command content. GCC attribute is added to both struct
> > btrfs_send_stream and read_buf to make sure read_buf is allocated
> > with proper alignment.
> >
> > Issue: #324
>
> The issue has a lot of interesting debugging and performance information
> so I'd put something to the changelog as well.
>
> The alignment fixup sounds correct, though I'd push it a bit further and
> move read_buf to the beginning of the structure and align the whole
> structure to 64 bytes, as this is the common cache line size. This could
> potentially help too with memcpy.
next prev parent reply other threads:[~2021-01-08 1:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-26 21:46 [PATCH] btrfs-progs: align btrfs receive buffer to enable fast CRC shngmao
2021-01-03 2:53 ` Wang Yugui
2021-01-06 12:16 ` David Sterba
2021-01-08 1:58 ` Sheng Mao [this message]
2021-01-14 18:37 ` David Sterba
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=20210108015804.GA3423@hosting.home \
--to=shngmao@gmail.com \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@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