[RFC] cache line contention for the per-cpu counters

Manfred Spraul (manfreds@colorfullife.com)
Thu, 28 Oct 1999 21:53:21 +0200


I've noticed that many per-cpu counters are simple arrays:

unsigned int local_bh_count[NR_CPUS];
unsigned int local_irq_count[NR_CPUS];
atomic_t nmi_counter[NR_CPUS];

I guess these variables are heavily used, and that the cachelines will
remain SHARED in all cpu's in the system. Lots of completely superflous
bus traffic.

What about reordering the arrays, and cache-line aligning everything?
ie.

struct {
atomic_t nmi_counter;
unsigned int local_bh_count;
unsigned int local_irq_count;
cpuinfo_x86 data;
...
} cpu[NR_CPUS];

--
	Manfred

- 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/