Skip to content
Snippets Groups Projects
Select Git revision
  • benchmark-tools
  • postgres-lambda
  • master default
  • REL9_4_25
  • REL9_5_20
  • REL9_6_16
  • REL_10_11
  • REL_11_6
  • REL_12_1
  • REL_12_0
  • REL_12_RC1
  • REL_12_BETA4
  • REL9_4_24
  • REL9_5_19
  • REL9_6_15
  • REL_10_10
  • REL_11_5
  • REL_12_BETA3
  • REL9_4_23
  • REL9_5_18
  • REL9_6_14
  • REL_10_9
  • REL_11_4
23 results

posix_sema.c

Blame
    • Thomas Munro's avatar
      46201d60
      Pad semaphores to avoid false sharing. · 46201d60
      Thomas Munro authored
      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
      46201d60
      History
      Pad semaphores to avoid false sharing.
      Thomas Munro authored
      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