xlc atomics
Noah Misch <noah@leadboat.com>
From: Noah Misch <noah@leadboat.com>
To: Andres Freund <andres@2ndquadrant.com>
Cc: Robert Haas <robertmhaas@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>,
Peter Geoghegan <pg@heroku.com>, Pg Hackers <pgsql-hackers@postgresql.org>,
Ants Aasma <ants@cybertec.at>
Date: 2015-07-04T22:40:41Z
Lists: pgsql-hackers
Attachments
- generic-xlc-v1.patch (text/plain) patch v1
On Wed, Jun 25, 2014 at 07:14:34PM +0200, Andres Freund wrote: > * gcc, msvc work. acc, xlc, sunpro have blindly written support which > should be relatively easy to fix up. I tried this on three xlc configurations. (1) "IBM XL C/C++ for AIX, V12.1 (5765-J02, 5725-C72)". Getting it working required the attached patch. None of my xlc configurations have an <atomic.h> header, and a web search turned up no evidence of one in connection with xlc platforms. Did you learn of a configuration needing atomic.h under xlc? The rest of the changes are hopefully self-explanatory in light of the documentation cited in generic-xlc.h. (Building on AIX has regressed in other ways unrelated to atomics; I will write more about that in due course.) (2) "IBM XL C/C++ for Linux, V13.1.2 (5725-C73, 5765-J08)" for ppc64le, http://www-01.ibm.com/support/docview.wss?uid=swg27044056&aid=1. This compiler has a Clang-derived C frontend. It defines __GNUC__ and offers GCC-style __sync_* atomics. Therefore, PostgreSQL selects generic-gcc.h. test_atomic_ops() fails because __sync_lock_test_and_set() of one-byte types segfaults at runtime. I have reported this to the vendor. Adding "pgac_cv_gcc_sync_char_tas=no" to the "configure" invocation is a good workaround. I could add a comment about that to src/test/regress/sql/lock.sql for affected folks to see in regression.diffs. To do better, we could make PGAC_HAVE_GCC__SYNC_CHAR_TAS perform a runtime test where possible. Yet another option is to force use of generic-xlc.h on this compiler. (3) "IBM XL C/C++ for Linux, V13.1.2 (5725-C73, 5765-J08)" for ppc64le, modifying atomics.h to force use of generic-xlc.h. While not a supported PostgreSQL configuration, I felt this would make an interesting data point. It worked fine after applying the patch developed for the AIX configuration. Thanks, nm
Commits
-
Avoid the use of a separate spinlock to protect a LWLock's wait queue.
- 008608b9d510 9.6.0 cited
-
Improve LWLock scalability.
- ab5194e6f617 9.5.0 cited
-
Reduce the number of semaphores used under --disable-spinlocks.
- daa7527afc22 9.4.0 cited
-
Alter the configure script to fail immediately if the C compiler does not
- d15cb38dec01 9.0.0 cited