lkml.org 
[lkml]   [2000]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Cache coherency... and locking
Date
On Thu, 27 Jul 2000 19:16:41 -0700, 
"Linda Walsh" <law@sgi.com> wrote:
>Cache lines on the MIPS-NUMA use a 128-byte (not bit) cache line,
>so for optimal performance, you'd want you weren't sharing
>that cache line w/any other frequently used/modified data.
>Now how to guarantee proper cache alignment on a given
>platform....hmmm

Like this. No need for a pad field, gcc automatically pads the
structure to the correct size.

typedef struct {
unsigned int __local_irq_count;
unsigned int __local_bh_count;
unsigned int __nmi_counter;
} ____cacheline_aligned irq_cpustat_t;

____cacheline_aligned is defined in linux/cache.c.

#define ____cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES)))

SMP_CACHE_BYTES defaults to L1_CACHE_BYTES. L1_CACHE_BYTES is defined
in asm/cache.c; some arch's hard code it, others pick it up from a
CONFIG variable which depends on the machine type.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:57    [W:0.091 / U:2.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site