Re: cacheline alignment and per-cpu data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>>>>> "Chase" == Chase Venters <[email protected]> writes:

Chase> On Fri, 9 Jun 2006, Chris Friesen wrote:
>> Will this cause cacheline pingpong?  If I do this sort of thing do
>> I need to ensure that the struct is a multiple of cacheline size
>> (or specify cacheline alignement)?

Chase> Yes. If CPU 2 tries to write to struct member 1 of array
Chase> element 2, and array element 1 is in CPU 1's cache, it must be
Chase> invalidated.

Chase> GCC (and kernel macros) provide good support for enforced
Chase> cacheline alignment, but it's also possible to pad your
Chase> structures.

Best way to go is to use __cacheline_aligned rather than try to get
the padding right manually. Someone will add a field somewhere in the
middle and mess it up and nobody notices.

Cheers,
Jes
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux