Subject: Re: [RFC][PATCH] net drivers and cache alignment

From: Jeff Garzik <[email-masked]>
Date: Sat, 07 Dec 2002 18:42:57 -0500

J.A. Magallon wrote:
> On 2002.12.08 Andrew Morton wrote:
> 
>>Jeff Garzik wrote:
>>
>>>David S. Miller wrote:
>>>
>>>>Can't the cacheline_aligned attribute be applied to individual
>>>>struct members?  I remember doing this for thread_struct on
>>>>sparc ages ago.
>>>
>>>Looks like it from the 2.4 processor.h code.
>>>
>>>Attached is cut #2.  Thanks for all the near-instant feedback so far :)
>>>  Andrew, does the attached still need padding on SMP?
>>
> 
> What do you all think about this:
> 
> #include <stdio.h>
> 
> #define CACHE_LINE_SIZE 128
> #define ____cacheline_aligned __attribute__((__aligned__(CACHE_LINE_SIZE)))
> 
> #define __cacheline_start   struct { } ____cacheline_aligned;

if you can mark struct members with attributes, as it appears you can, 
there's no need to define a struct.

	Jeff