On Tue, 2012-03-06 at 09:32 +, Arnd Bergmann wrote:
> On Tuesday 06 March 2012, Alex Shi wrote:
> > I have one concern and one questions here:
> > concern: maybe the lock is in a well designed 'packed' struct, and it is
> > safe for cross lines issue
> I think the check should be (__alignof__(lock) < __alignof__(rwlock_t)),
> otherwise it will still pass when you have structure with
> attribute((packed,aligned(2)))
reasonable!
>
>> 1, it is alignof bug for default gcc on my fc15 and Ubuntu 11.10 etc?
>>
>> struct sub {
>> int raw
On Wed, 2012-03-07 at 14:39 +0100, Ingo Molnar wrote:
> * Alex Shi wrote:
>
> > > I think the check should be (__alignof__(lock) <
> > > __alignof__(rwlock_t)), otherwise it will still pass when
> > > you have structure with attribute((packed,aligned(2)))
&g
> > 1, it is alignof bug for default gcc on my fc15 and Ubuntu 11.10 etc?
> >
> > struct sub {
> > int raw_lock;
> > char a;
> > };
> > struct foo {
> > struct sub z;
> > int slk;
> > char y;
> > }__attribute__((packed));
> >
> > struct foo f1;
> >
> > __
On Thu, 2012-03-08 at 08:13 +0100, Ingo Molnar wrote:
> * Alex Shi wrote:
>
> > On Wed, 2012-03-07 at 14:39 +0100, Ingo Molnar wrote:
> > > * Alex Shi wrote:
> > >
> > > > > I think the check should be (__alignof__(lock) <
> > > >