pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Pad semaphores to avoid false sharing.
3+ messages / 1 participants
[nested] [flat]

* pgsql: Pad semaphores to avoid false sharing.
@ 2018-07-24 23:05 Thomas Munro <tmunro@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Thomas Munro @ 2018-07-24 23:05 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Pad semaphores to avoid false sharing.

In a USE_UNNAMED_SEMAPHORES build, the default on Linux and FreeBSD
since commit ecb0d20a, we have an array of sem_t objects.  This
turned out to reduce performance compared to the previous default
USE_SYSV_SEMAPHORES on an 8 socket system.  Testing showed that the
lost performance could be regained by padding the array elements so
that they have their own cache lines.  This matches what we do for
similar hot arrays (see LWLockPadded, WALInsertLockPadded).

Back-patch to 10, where unnamed semaphores were adopted as the default
semaphore interface on those operating systems.

Author: Thomas Munro
Reviewed-by: Andres Freund
Reported-by: Mithun Cy
Tested-by: Mithun Cy, Tom Lane, Thomas Munro
Discussion: https://postgr.es/m/CAD__OugYDM3O%2BdyZnnZSbJprSfsGFJcQ1R%3De59T3hcLmDug4_w%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/2d3067595299d2ac1f29bbc26a83a99d59b33d4e

Modified Files
--------------
src/backend/port/posix_sema.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Pad semaphores to avoid false sharing.
@ 2018-07-24 23:06 Thomas Munro <tmunro@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Thomas Munro @ 2018-07-24 23:06 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Pad semaphores to avoid false sharing.

In a USE_UNNAMED_SEMAPHORES build, the default on Linux and FreeBSD
since commit ecb0d20a, we have an array of sem_t objects.  This
turned out to reduce performance compared to the previous default
USE_SYSV_SEMAPHORES on an 8 socket system.  Testing showed that the
lost performance could be regained by padding the array elements so
that they have their own cache lines.  This matches what we do for
similar hot arrays (see LWLockPadded, WALInsertLockPadded).

Back-patch to 10, where unnamed semaphores were adopted as the default
semaphore interface on those operating systems.

Author: Thomas Munro
Reviewed-by: Andres Freund
Reported-by: Mithun Cy
Tested-by: Mithun Cy, Tom Lane, Thomas Munro
Discussion: https://postgr.es/m/CAD__OugYDM3O%2BdyZnnZSbJprSfsGFJcQ1R%3De59T3hcLmDug4_w%40mail.gmail.com

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f2db5f3bb0b5d429e9fa5b093936f8524e4192b1

Modified Files
--------------
src/backend/port/posix_sema.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Pad semaphores to avoid false sharing.
@ 2018-07-24 23:06 Thomas Munro <tmunro@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Thomas Munro @ 2018-07-24 23:06 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Pad semaphores to avoid false sharing.

In a USE_UNNAMED_SEMAPHORES build, the default on Linux and FreeBSD
since commit ecb0d20a, we have an array of sem_t objects.  This
turned out to reduce performance compared to the previous default
USE_SYSV_SEMAPHORES on an 8 socket system.  Testing showed that the
lost performance could be regained by padding the array elements so
that they have their own cache lines.  This matches what we do for
similar hot arrays (see LWLockPadded, WALInsertLockPadded).

Back-patch to 10, where unnamed semaphores were adopted as the default
semaphore interface on those operating systems.

Author: Thomas Munro
Reviewed-by: Andres Freund
Reported-by: Mithun Cy
Tested-by: Mithun Cy, Tom Lane, Thomas Munro
Discussion: https://postgr.es/m/CAD__OugYDM3O%2BdyZnnZSbJprSfsGFJcQ1R%3De59T3hcLmDug4_w%40mail.gmail.com

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/46201d603f9c79d99e56ce62fb71aae31a99303d

Modified Files
--------------
src/backend/port/posix_sema.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2018-07-24 23:06 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-07-24 23:05 pgsql: Pad semaphores to avoid false sharing. Thomas Munro <tmunro@postgresql.org>
2018-07-24 23:06 pgsql: Pad semaphores to avoid false sharing. Thomas Munro <tmunro@postgresql.org>
2018-07-24 23:06 pgsql: Pad semaphores to avoid false sharing. Thomas Munro <tmunro@postgresql.org>

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