Netdev List
 help / color / mirror / Atom feed
* [RFC] change dst_entry padding from using an array to using __attribute__
@ 2010-04-07 16:46 Laurent Chavey
  2010-04-07 16:55 ` Eric Dumazet
  0 siblings, 1 reply; 3+ messages in thread
From: Laurent Chavey @ 2010-04-07 16:46 UTC (permalink / raw)
  To: netdev; +Cc: laurent chavey

what are the benefit(s)  of using an array to force a struct
element to be aligned on 64 bytes / 32 bytes boundaries
versus using gcc __attribute__.


------------------------------------

struct dst_entry {

       /*
        * Align __refcnt to a 64 bytes alignment
        * (L1_CACHE_SIZE would be too much)
        */
- #ifdef CONFIG_64BIT
-       long                    __pad_to_align_refcnt[1];
- #else
-       long                    __pad_to_align_refcnt[0];
- #endif
+       atomic_t                __refcnt __attribute__
((aligned(64))); /* client references    */
#undef __padding__
       /*
        * __refcnt wants to be on a different cache line from
        * input/output/ops or performance tanks badly
        */
       atomic_t                __refcnt;       /* client references    */
};

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-04-07 16:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-07 16:46 [RFC] change dst_entry padding from using an array to using __attribute__ Laurent Chavey
2010-04-07 16:55 ` Eric Dumazet
2010-04-07 16:56   ` Eric Dumazet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox