Re: Performance under contention

From: Dave Crooke <dcrooke(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Jignesh Shah <jkshah(at)gmail(dot)com>, Ivan Voras <ivoras(at)freebsd(dot)org>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Performance under contention
Date: 2010-12-07 18:00:58
Message-ID: AANLkTin6k6drOzrcJKSNNa=aVDAi8b5pG29V3G4whh4x@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi Tom

I suspect I may be missing something here, but I think it's a pretty
universal truism that cache lines are aligned to power-of-2 memory
addresses, so it would suffice to ensure during setup that the lower order n
bits of the object address are all zeros for each critical object; if the
malloc() routine being used doesn't support that, it could be done by
allocating a slightly larger than necessary block of memory and choosing a
location within that.

The value of n could be architecture dependent, but n=8 would cover
everyone, hopefully without wasting too much RAM.

Cheers
Dave

On Tue, Dec 7, 2010 at 11:50 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

>
> One thing that might be interesting, but that I don't know how to attack
> in a reasonably machine-independent way, is to try to ensure that shared
> and local data structures don't accidentally overlap within cache lines.
> When they do, you pay for fighting the cache line away from another
> processor even when there's no real need.
>
> regards, tom lane
>
> --
> Sent via pgsql-performance mailing list (pgsql-performance(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-performance
>

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Ivan Voras 2010-12-07 18:08:06 Re: Performance under contention
Previous Message Tom Lane 2010-12-07 17:50:43 Re: Performance under contention