Re: Page replacement algorithm in buffer cache - Mailing list pgsql-hackers

From Ants Aasma
Subject Re: Page replacement algorithm in buffer cache
Date
Msg-id CA+CSw_vSJ49cHKKBhCFpd39h6Eud2LF6PKkME-=kUd7E2MzQRg@mail.gmail.com
Whole thread Raw
In response to Re: Page replacement algorithm in buffer cache  (Atri Sharma <atri.jiit@gmail.com>)
List pgsql-hackers
On Sat, Mar 23, 2013 at 6:29 AM, Atri Sharma <atri.jiit@gmail.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



pgsql-hackers by date:

Previous
From: Adriano Lange
Date:
Subject: Re: SDP query optimizer
Next
From: Ants Aasma
Date:
Subject: Re: Page replacement algorithm in buffer cache