X-Original-To: pgsql-ports-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 111769FA1B0 for ; Fri, 12 May 2006 15:58:25 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 26504-06 for ; Fri, 12 May 2006 15:58:05 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from unicorn.rentec.com (unicorn.rentec.com [216.223.240.10]) by postgresql.org (Postfix) with ESMTP id 28C669F946D for ; Fri, 12 May 2006 15:58:00 -0300 (ADT) Received: from wren.rentec.com (wren [192.5.35.106]) by unicorn.rentec.com (8.13.6/8.12.1) with ESMTP id k4CIvqOX015398 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 12 May 2006 14:57:53 -0400 (EDT) X-Source: non-mednet Received: from [172.26.132.145] (hoopoe.rentec.com [172.26.132.145]) by wren.rentec.com (8.13.1/8.12.1) with ESMTP id k4CIvqFA012298; Fri, 12 May 2006 14:57:52 -0400 (EDT) Message-ID: <4464DAB0.70900@rentec.com> Date: Fri, 12 May 2006 14:57:52 -0400 From: Alan Stange Reply-To: stange@rentec.com Organization: Renaissance Technologies Corp. User-Agent: Mail/News 1.5.0.2 (X11/20060427) MIME-Version: 1.0 To: Tom Lane CC: Bruce Momjian , pgsql-ports@postgresql.org Subject: Re: solaris build problem with Sun compilers References: <200605112316.k4BNGeB17324@candle.pha.pa.us> <4463D639.3030802@rentec.com> <4464B653.1040301@rentec.com> <5470.1147451501@sss.pgh.pa.us> <4464C950.40906@rentec.com> <12675.1147457431@sss.pgh.pa.us> In-Reply-To: <12675.1147457431@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Logged: Logged by unicorn.rentec.com as k4CIvqOX015398 at Fri May 12 14:57:53 2006 X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/32 X-Sequence-Number: 2413 Tom Lane wrote: > Alan Stange writes: >> Hmmm. I've just been looking at the last snapshot of the HEAD and >> s_lock.h is still using an ldstub instruction instead of a cas for the >> inlined tas() function when gcc is being used. Having a cas >> instruction here would probably be an improvement too, right? > > [ shrug... ] The person who submitted the solaris_sparc.s change failed > to provide any evidence that it was anything but cosmetic, so I didn't > worry about changing the equivalent gcc code. If there's actually a > performance win, please cite chapter and verse. Also, shouldn't we be > worrying about breaking older Sparc chips? Does CAS go all the way > back? Well, in principle the cas variant is better as fewer memory writes occur. I'm unable to cite chapter and verse on this detail, but it is "better". I'm fairly sure CAS was included in the v9 instruction set. I was actually surprised to see that you had allowed it in just for this reason. I'm fairly sure this will break any program that needs to link against the postgresql libs using a "v8" 32 bit version. Either way, my original observation is that you ought to have the same thing in either location. I'd leave the ldstub version (minus the useless compare and assignment instructions) until you're sure everyone is running v8plusb or v9 binaries. Not that it matters here and now, but Solaris 10 includes atomic_ops in libc which are probably all inlined when using the Sun compiler. It's just what you want here and would hide most of these details. I believe these were also added in a Solaris 9 update. See "man atomic_ops" for details. >> Finally, I noticed that pg_sleep is calling select() for a sleep. On >> Solaris, this is a fairly expensive way to get off the run queue >> compared to just calling nanosleep(). How often do backends go to >> sleep here under "typical" workloads? > > If you actually reach that syscall you're screwed performance-wise > anyhow. I'm disinclined to mess with OS-specific variants of the > delay logic. Not a problem. I was just poking around and asking questions. -- Alan