lkml.org 
[lkml]   [2012]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC patch] spindep: add cross cache lines checking
From
Date
Resend for correct tglx's address. Sorry!
> > >
> > > Have you tried making this a compile-time check using
> > > __alignof__? I would say that any spinlock in a packed data
> > > structure is basically a bug, even more so on most other
> > > architectures besides x86.
>
> 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. but __alignof__ will return 1;
>
> struct abc{
> raw_spinlock_t lock1;
> char a;
> char b;
> }__attribute__((packed));
>
> Since the lock is the first object of struct, usually it is well placed.
>
> question: I am a idiot on gcc, I tried some parameters of gcc " --param
> l1-cache-line-size=1 -mno-align-double" and can not make a cross lines
> variable without 'packed' structure, but I still don't find a grantee
> why gcc can avoid the cross line variable if it's not in 'packed'
> structure?
>
> > agreed.
> >
> > Thanks,
> >
> > Ingo
>




\
 
 \ /
  Last update: 2012-03-06 07:21    [W:0.056 / U:0.716 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site