pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim Nasby <Jim.Nasby@BlueTreble.com>
To: Andres Freund <andres@anarazel.de>
To: Craig Ringer <craig@2ndquadrant.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alexander Korotkov <a.korotkov@postgrespro.ru>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Should we cacheline align PGXACT?
Date: Sun, 12 Feb 2017 19:57:06 -0600
Message-ID: <4a417f52-d1e1-a1ae-49c0-25685d847f15@BlueTreble.com> (raw)
In-Reply-To: <20160822052432.gi2c7ktqltt3diki@alap3.anarazel.de>
References: <CAPpHfdtJY4zOEDsjad6J5AyZMqZcv6gSY9AkKpA7qN3jyQ2+1Q@mail.gmail.com>
	<31991.1471614372@sss.pgh.pa.us>
	<20160822024044.cce36j45obqm6dji@alap3.anarazel.de>
	<CAMsr+YGEN_9BdTyc2ep92HqrLXUOmpGp2QfGV=9MeV6A=__o5A@mail.gmail.com>
	<20160822052432.gi2c7ktqltt3diki@alap3.anarazel.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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)


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (84+ messages)  latest in thread

Message-ID: <4a417f52-d1e1-a1ae-49c0-25685d847f15@BlueTreble.com>
Permalink:  ../4a417f52-d1e1-a1ae-49c0-25685d847f15@BlueTreble.com/
Also on:    postgresql.org/message-id/4a417f52-d1e1-a1ae-49c0-25685d847f15@BlueTreble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: Jim.Nasby@BlueTreble.com, andres@anarazel.de, craig@2ndquadrant.com, tgl@sss.pgh.pa.us, a.korotkov@postgrespro.ru
  Subject: Re: Should we cacheline align PGXACT?
  In-Reply-To: <4a417f52-d1e1-a1ae-49c0-25685d847f15@BlueTreble.com>
  References: <CAPpHfdtJY4zOEDsjad6J5AyZMqZcv6gSY9AkKpA7qN3jyQ2+1Q@mail.gmail.com> <31991.1471614372@sss.pgh.pa.us> <20160822024044.cce36j45obqm6dji@alap3.anarazel.de> <CAMsr+YGEN_9BdTyc2ep92HqrLXUOmpGp2QfGV=9MeV6A=__o5A@mail.gmail.com> <20160822052432.gi2c7ktqltt3diki@alap3.anarazel.de> <4a417f52-d1e1-a1ae-49c0-25685d847f15@BlueTreble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox