From: Andreas Schwab <schwab@redhat.com>
To: Eric Paris <eparis@redhat.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@sophos.com>,
Andreas Gruenbacher <agruen@suse.de>,
"linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: struct fanotify_event_metadata
Date: Fri, 20 Aug 2010 15:27:42 +0200 [thread overview]
Message-ID: <m339u976sx.fsf@hase.home> (raw)
In-Reply-To: <1282310016.21419.2161.camel@acb20005.ipt.aol.com> (Eric Paris's message of "Fri, 20 Aug 2010 09:13:36 -0400")
Eric Paris <eparis@redhat.com> writes:
> Can you help me understand the packed attribute and why it hurts in this
> case?
It changes the alignment of all applicable objects to 1 which means that
the compiler cannot assume _any_ aligment. Thus on STRICT_ALIGNMENT
targets it has to use more expensive access methods to avoid generating
unaligned loads and stores (unless it can infer proper alignment from
the context).
You can add an aligned attribute to raise the assumed alignment again.
Of course, this can only work correctly if the actual alignment of the
object matches the declared one.
> I'm going to compile a couple of test programs (I only have x86 and
> x86_64) to see if I can find what the assembly is doing different but
> maybe you can point me at the information more easily?
Neither x86 nor x86-64 are STRICT_ALIGNMENT targets.
Andreas.
--
Andreas Schwab, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E
"And now for something completely different."
next prev parent reply other threads:[~2010-08-20 13:27 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-14 17:44 struct fanotify_event_metadata Andreas Schwab
2010-08-19 15:44 ` Tvrtko Ursulin
2010-08-19 16:07 ` Andreas Gruenbacher
2010-08-19 16:35 ` Tvrtko Ursulin
2010-08-19 17:53 ` Eric Paris
2010-08-20 9:02 ` Tvrtko Ursulin
2010-08-20 9:16 ` Andreas Schwab
2010-08-20 9:23 ` Tvrtko Ursulin
2010-08-20 13:13 ` Eric Paris
2010-08-20 13:27 ` Andreas Schwab [this message]
2010-08-20 15:19 ` Eric Paris
2010-08-20 17:47 ` Eric Paris
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=m339u976sx.fsf@hase.home \
--to=schwab@redhat.com \
--cc=agruen@suse.de \
--cc=eparis@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tvrtko.ursulin@sophos.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.