[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <m339u976sx.fsf@hase.home>
Date: Fri, 20 Aug 2010 15:27:42 +0200
From: Andreas Schwab <schwab@...hat.com>
To: Eric Paris <eparis@...hat.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@...hos.com>,
Andreas Gruenbacher <agruen@...e.de>,
"linux-kernel\@vger.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: struct fanotify_event_metadata
Eric Paris <eparis@...hat.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@...hat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E
"And now for something completely different."
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists