[PATCH 1/5] powerpc: consolidate feature fixup code

Olof Johansson olof at lixom.net
Sat Oct 14 12:01:47 EST 2006


On Sat, 14 Oct 2006 08:36:46 +1000 Benjamin Herrenschmidt <benh at kernel.crashing.org> wrote:

> 
> > You can advance the pointer with L1_CACHE_BYTES/sizeof(int) per
> > iteration in the second loop here.
> 
> Yeah, I suppose so. Though I'm not 100% confident we get L1_CACHE_BYTES
> on all cpus, for example, PA6T is 64 bytes ;) We could use
> cur_cpu_spec->icache_bsize but that would involve ugly RELOC's to get it
> right on 32 bits. I decided not to care for now.

Ugh, yeah, I remember this when I did the patches but forgot about it
now. L1_CACHE_BYTES is used in a number of places, but overall used as
the largest value needed to bump between lines to avoid false sharing.

The other early places seems to have used hardcoded constants. I guess
it's better to just loop over every word like you're already doing. It
still avoids a barrier on every iteration.


-Olof



More information about the Linuxppc-dev mailing list