netdev
[Top] [All Lists]

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

To: "J.A. Magallon" <jamagallon@xxxxxxx>
Subject: Re: [RFC][PATCH] net drivers and cache alignment
From: Jeff Garzik <jgarzik@xxxxxxxxx>
Date: Sat, 07 Dec 2002 18:42:57 -0500
Cc: Andrew Morton <akpm@xxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <20021207233745.GE3183@xxxxxxxxxxxxxxxx>
References: <3DF2781D.3030209@xxxxxxxxx> <20021207.144004.45605764.davem@xxxxxxxxxx> <3DF27EE7.4010508@xxxxxxxxx> <3DF2844C.F9216283@xxxxxxxxx> <20021207233745.GE3183@xxxxxxxxxxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2) Gecko/20021202
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




<Prev in Thread] Current Thread [Next in Thread>