Re: struct fanotify_event_metadata

From: Eric Paris
Date: Fri Aug 20 2010 - 13:47:59 EST


On Fri, 2010-08-20 at 11:19 -0400, Eric Paris wrote:
> On Fri, 2010-08-20 at 15:27 +0200, Andreas Schwab wrote:
> > Eric Paris <eparis@xxxxxxxxxx> 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).
>
> Andreas suggested (I accidentally dropped the list when I ask him) I use
> natural alignment and explicit padding rather than ((packed))

What would anyone think of this patch (which is on top of Tvrtko's
reordering)?