From: "Will Newton" <will.newton@gmail.com>
To: "Harvey Harrison" <harvey.harrison@gmail.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [RFC-PATCH 1/5] unaligned: introduce common header
Date: Mon, 10 Nov 2008 11:49:22 +0000 [thread overview]
Message-ID: <87a5b0800811100349n435785by27ebc4e495bb7985@mail.gmail.com> (raw)
In-Reply-To: <1226290940.5478.3.camel@brick>
On Mon, Nov 10, 2008 at 4:22 AM, Harvey Harrison
<harvey.harrison@gmail.com> wrote:
(add back lkml cc that I mistakenly dropped)
> On Sat, 2008-11-08 at 12:47 +0000, Will Newton wrote:
>> On Wed, Nov 5, 2008 at 6:16 PM, Harvey Harrison
>> <harvey.harrison@gmail.com> wrote:
>>
>> > The memmove-based arches (m32r, xtensa, h8300) are likely going to be fine with this change
>> > barring compiler bugs that made them go with memmove in the first place.
>>
>> As I understand it the need for the memmove implementation is not
>> compiler bugs but default struct alignment. The packed struct
>> implementation will only work with compilers where structs can be
>> aligned on byte boundaries, it's fairly common for RISC architectures
>> to align structs to 4 or 8 byte boundaries.
>
> Which I believe is disabled entirely using __attribute__((packed)), no?
As far as I am aware the packed attribute is handled in this way for
some toolchains (arm in particular). Not everybody does it, and for
good reasons. For example if I have this struct on an architecture
with 8 byte default struct alignment:
struct foo {
u64 big_data;
u8 small_data;
u32 medium_data;
} __attribute__((packed));
Should big_data be accessed as 8 byte load instructions rather than
one 64bit load instruction? It's a pretty large performance penalty to
pay when all I really want is for medium_data to be accessed
correctly.
next prev parent reply other threads:[~2008-11-10 11:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-05 18:16 Harvey Harrison
[not found] ` <87a5b0800811080447m2cebebb7j77afe9592f72ab11@mail.gmail.com>
[not found] ` <1226290940.5478.3.camel@brick>
2008-11-10 11:49 ` Will Newton [this message]
2008-11-10 16:51 ` Harvey Harrison
2008-11-10 18:35 ` Will Newton
2008-11-10 18:51 ` Harvey Harrison
2008-11-11 9:50 ` Will Newton
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=87a5b0800811100349n435785by27ebc4e495bb7985@mail.gmail.com \
--to=will.newton@gmail.com \
--cc=harvey.harrison@gmail.com \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®