Re: Page replacement algorithm in buffer cache

From: Ants Aasma <ants(at)cybertec(dot)at>
To: Atri Sharma <atri(dot)jiit(at)gmail(dot)com>
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Greg Stark <stark(at)mit(dot)edu>, Amit Kapila <amit(dot)kapila(at)huawei(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Page replacement algorithm in buffer cache
Date: 2013-03-23 12:02:41
Message-ID: CA+CSw_vSJ49cHKKBhCFpd39h6Eud2LF6PKkME-=kUd7E2MzQRg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Mar 23, 2013 at 6:29 AM, Atri Sharma <atri(dot)jiit(at)gmail(dot)com> wrote:
> One way to distribute memory contention in case of spinlocks could be
> to utilize the fundamentals of NUMA architecture. Specifically, we can
> let the contending backends spin on local flags instead on the buffer
> header flags directly. As access to local cache lines is much cheaper
> and faster than memory locations which are far away in NUMA, we could
> potentially reduce the memory overhead for a specific line and reduce
> the overall overheads as well.

This is not even something for NUMA architectures (which is by now all
multiprocessor machines), even multicore machines have overheads for
bouncing cache lines. The locks don't even have to be local, it's good
enough to just have better probability of each backend contending
hitting a different lock, if we take care of not having the locks
share cache lines. IMO that's the whole point of striping locks, the
critical section is usually cheaper than the cost of getting the cache
line in an exclusive state.

Regards,
Ants Aasma
--
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt
Web: http://www.postgresql-support.de

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ants Aasma 2013-03-23 12:41:17 Re: Page replacement algorithm in buffer cache
Previous Message Adriano Lange 2013-03-23 11:44:15 Re: SDP query optimizer