X-Original-To: pgsql-ports-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1A055D99B3 for ; Tue, 27 Sep 2005 20:38:21 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 68657-01 for ; Tue, 27 Sep 2005 23:38:14 +0000 (GMT) Received: from www.conducivetech.com (conducivetech.com [64.65.134.45]) by svr1.postgresql.org (Postfix) with ESMTP id 5AD53D94C9 for ; Tue, 27 Sep 2005 20:38:15 -0300 (ADT) Received: from dentaku.sight-n-sound.com (dentaku.sight-n-sound.com [198.107.31.201]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by www.conducivetech.com (Postfix) with ESMTP id 17E721838B for ; Tue, 27 Sep 2005 16:38:18 -0700 (PDT) From: Michael Crozier To: pgsql-ports@postgresql.org Subject: TAS definitions on Solaris x86 with GCC Date: Tue, 27 Sep 2005 16:38:12 -0700 User-Agent: KMail/1.8.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200509271638.12467.crozierm@conducivetech.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 required=5 tests=[none] X-Spam-Level: X-Archive-Number: 200509/18 X-Sequence-Number: 2212 Hello, I'm again looking at tas/spinlock build problems while investigating unusually high CPU usage during load testing. My issue was first mentioned here: http://archives.postgresql.org/pgsql-ports/2005-09/msg00001.php Version details: Postgresql 7.4.8 Solaris 10, AMD64 GCC 3.4.3 To my untrained eye, it appears that configure chooses two versions of tas() for this combination (regardless of 32/64-bitness). I'm trying to determine whether this is a correct interpretation and if so, which version of tas() of the correct version to be using with GCC on Solaris. When building Postgresql on Solaris using GCC, the configure script appears to link tas.s to tas/solaris_i386.s. This file compiles in 32bit mode, but not in 64bit (I manually linked to dummy.s when compiling in 64bit). The following symbols are from the 32bit build. $ nm src/backend/port/tas.o 00000000 T tas $ nm src/backend/port/SUBSYS.o | grep tas 00000c90 T tas In addition to tas.s, configure also enables the proper #defs for the inline tas() definition in s_lock.h: --- from line 97 --- #if defined(__i386__) || defined(__x86_64__) /* AMD Opteron */ #define TAS(lock) tas(lock) static __inline__ int tas(volatile slock_t *lock) { register slock_t _res = 1; __asm__ __volatile__( " lock \n" " xchgb %0,%1 \n" : "=q"(_res), "=m"(*lock) : "0"(_res)); return (int) _res; } These three tas symbols included from s_lock.h: src/backend/storage/lmgr/lwlock.o 000002fa t tas src/backend/storage/lmgr/proc.o 00000483 t tas src/backend/storage/lmgr/s_lock.o 0000017b t tas src/backend/storage/lmgr/SUBSYS.o 000047e2 t tas 0000270b t tas 00004c3b t tas Thanks for any suggestions or insight, Michael Crozier