On 8/22/16 12:24 AM, Andres Freund wrote:
>> Somewhat naïve question from someone with much less clue about low level
>> cache behaviour trying to follow along: given that we determine such
>> padding at compile time, how do we ensure that the cacheline size we're
>> targeting is right at runtime?
> There's basically only very few common cacheline sizes. Pretty much only
> 64 byte and 128 bytes are common these days. By usually padding to the
> larger of those two, we waste a bit of memory, but not actually cache
> space on platforms with smaller lines, because the padding is never
> accessed.
Though, with an N-way associative cache 2x more padding than necessary
cuts the amount you can fit into the cache by half. That could be
meaningful in some cases.
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532)