pg.ddx.io  pgsql-ports@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Crozier <crozierm@conducivetech.com>
To: pgsql-ports@postgresql.org
Subject: TAS definitions on Solaris x86 with GCC
Date: Tue, 27 Sep 2005 16:38:12 -0700
Message-ID: <200509271638.12467.crozierm@conducivetech.com> (raw)


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





view thread (3+ messages)  latest in thread

Message-ID: <200509271638.12467.crozierm@conducivetech.com>
Permalink:  ../200509271638.12467.crozierm@conducivetech.com/
Also on:    postgresql.org/message-id/200509271638.12467.crozierm@conducivetech.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-ports@postgresql.org
  Cc: crozierm@conducivetech.com
  Subject: Re: TAS definitions on Solaris x86 with GCC
  In-Reply-To: <200509271638.12467.crozierm@conducivetech.com>
  References: <200509271638.12467.crozierm@conducivetech.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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