Re: [HACKERS] Should we cacheline align PGXACT? - Mailing list pgsql-hackers

From Jim Nasby
Subject Re: [HACKERS] Should we cacheline align PGXACT?
Date
Msg-id 4a417f52-d1e1-a1ae-49c0-25685d847f15@BlueTreble.com
Whole thread Raw
In response to Re: Should we cacheline align PGXACT?  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
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)



pgsql-hackers by date:

Previous
From: Jim Nasby
Date:
Subject: Re: [HACKERS] Checksums by default?
Next
From: Jim Nasby
Date:
Subject: Re: [HACKERS] removing tsearch2