postgresql/contrib/pg_buffercache
Andres Freund ed127002d8 Align buffer descriptors to cache line boundaries.
Benchmarks has shown that aligning the buffer descriptor array to
cache lines is important for scalability; especially on bigger,
multi-socket, machines.

Currently the array sometimes already happens to be aligned by
happenstance, depending how large previous shared memory allocations
were. That can lead to wildly varying performance results after minor
configuration changes.

In addition to aligning the start of descriptor array, also force the
size of individual descriptors to be of a common cache line size (64
bytes). That happens to already be the case on 64bit platforms, but
this way we can change the struct BufferDesc more easily.

As the alignment primarily matters in highly concurrent workloads
which probably all are 64bit these days, and the space wastage of
element alignment would be a bit more noticeable on 32bit systems, we
don't force the stride to be cacheline sized on 32bit platforms for
now. If somebody does actual performance testing, we can reevaluate
that decision by changing the definition of BUFFERDESC_PADDED_SIZE.

Discussion: 20140202151319.GD32123@awork2.anarazel.de

Per discussion with Bruce Momjan, Tom Lane, Robert Haas, and Peter
Geoghegan.
2015-01-29 22:48:45 +01:00
..
Makefile Add pinning_backends column to the pg_buffercache extension. 2014-08-22 00:28:37 +02:00
pg_buffercache_pages.c Align buffer descriptors to cache line boundaries. 2015-01-29 22:48:45 +01:00
pg_buffercache--1.0--1.1.sql Add pinning_backends column to the pg_buffercache extension. 2014-08-22 00:28:37 +02:00
pg_buffercache--1.1.sql Add pinning_backends column to the pg_buffercache extension. 2014-08-22 00:28:37 +02:00
pg_buffercache--unpackaged--1.0.sql Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:37 +02:00
pg_buffercache.control Add pinning_backends column to the pg_buffercache extension. 2014-08-22 00:28:37 +02:00