From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>,
"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
Linux FS Devel <linux-fsdevel@vger.kernel.org>
Subject: Re: Proper packed attribute usage?
Date: Mon, 17 Jun 2019 08:37:01 -0700 [thread overview]
Message-ID: <1560785821.3538.22.camel@HansenPartnership.com> (raw)
In-Reply-To: <f24ea8b6-01ff-f570-4b9b-43b4126118e6@gmx.com>
[-- Attachment #1: Type: text/plain, Size: 743 bytes --]
On Mon, 2019-06-17 at 17:06 +0800, Qu Wenruo wrote:
[...]
> But then this means, we should have two copies of data for every such
> structures. One for the fixed format one, and one for the compiler
> aligned one, with enough helper to convert them (along with needed
> endian convert).
I don't think it does mean this. The compiler can easily access the
packed data by pointer, the problem on systems requiring strict
alignment is that it has to be done with byte accesses, so instead of a
load word for a pointer to an int, you have to do four load bytes.
This is mostly a minor slowdown so trying to evolve a whole
infrastructure around copying data for these use cases really wouldn't
be a good use of resources.
James
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2019-06-17 15:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-17 9:06 Proper packed attribute usage? Qu Wenruo
2019-06-17 13:18 ` David Sterba
2019-06-17 13:40 ` Qu Wenruo
2019-06-17 15:37 ` James Bottomley [this message]
2019-06-18 1:07 ` Qu Wenruo
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=1560785821.3538.22.camel@HansenPartnership.com \
--to=james.bottomley@hansenpartnership.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=quwenruo.btrfs@gmx.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;
as well as URLs for NNTP newsgroup(s).