Red Hat Bugzilla – Bug 159694
PostgreSQL 7.3 doesn't have spinlock support on x86_64
Last modified: 2013-07-02 23:06:07 EDT
Description of problem:
For lack of any built-in assembly code support for spinlocks on x86_64, our RHEL3 PostgreSQL build is
falling back to using SysV IPC semaphore kernel calls for operations that ought to take a couple of
machine instructions. This is a pretty horrid performance loss, and can even result in database startup
failure if the number of semaphores needed exceeds what the kernel is configured to allow (see
referenced URL for an example)
Version-Release number of selected component (if applicable):
Need to backport assembly-code spinlock support from later Postgres versions. Also check to see if
any other platforms supported by RHEL3 have similar problems.
It turns out that ppc64 spinlock support is missing too.
On investigation, the best bet seems to be to update s_lock.h and s_lock.c to
exactly match the PostgreSQL 7.4 sources; we know that code works from both
community testing and our own usage in RHEL4. We could fix the immediate
problems with a slightly smaller patch, but a partial backport seems to me more
likely to create new issues than avoid them.
My previous comment that ppc64 spinlock support is needed was incorrect; there
was already a patch in the RPMs that added ppc64 support. The ppc64 code in 7.4
is marginally more efficient, though.
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.