Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 32E1E632F94 for ; Wed, 24 Jun 2009 12:27:12 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 86366-02 for ; Wed, 24 Jun 2009 12:27:11 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og109.obsmtp.com (exprod7og109.obsmtp.com [64.18.2.171]) by mail.postgresql.org (Postfix) with SMTP id 95D866325AF for ; Wed, 24 Jun 2009 12:27:10 -0300 (ADT) Received: from source ([209.85.219.217]) by exprod7ob109.postini.com ([64.18.6.12]) with SMTP ID DSNKSkJFzAUcF2/MzyU/WEGjJ8ejcnNk5NV0@postini.com; Wed, 24 Jun 2009 08:27:10 PDT Received: by mail-ew0-f217.google.com with SMTP id 17so1299712ewy.28 for ; Wed, 24 Jun 2009 08:27:08 -0700 (PDT) Received: by 10.210.102.12 with SMTP id z12mr862641ebb.80.1245857227895; Wed, 24 Jun 2009 08:27:07 -0700 (PDT) Received: from oxford.xeocode.com.mit.edu ([87.127.95.198]) by mx.google.com with ESMTPS id 10sm630820eyd.48.2009.06.24.08.27.06 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 24 Jun 2009 08:27:07 -0700 (PDT) To: Theo Schlossnagle Cc: Tom Lane Cc: Bruce Momjian , pgsql-bugs@postgresql.org, josh.berkus@sun.com, robert.lor@sun.com Subject: Re: BUG #2401: spinlocks not available on amd64 In-Reply-To: <4447A288.6020409@omniti.com> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-Draft-From: ("nnimap+imap.gmail.com:EDB" 23781) References: <4447A288.6020409@omniti.com> From: Gregory Stark Date: Wed, 24 Jun 2009 16:27:02 +0100 Message-ID: <877hz1abzt.fsf_-_@oxford.xeocode.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200906/242 X-Sequence-Number: 23320 Theo Schlossnagle wrote: > Tom Lane wrote: > >> There is no reason for the i386 or AMD64 code to be different from what's >> already tested on Linux --- the hardware's the same and the OS surely >> doesn't make a difference at this level. > > On linux you use gcc, which allows for inline assembly. So, the code is > already very different. How does this interact with binary builds such as rpms? If someone installs an amd64 binary on an x86 machine or vice versa does this assembly do the right thing at all? Does it perform slowly? Ideally we would compile both and pick the right one at run-time but that might have annoying overhead if there's a branch before every pg_atomic_cas call. Perhaps a minimal thing to do would be to detect a mismatch on startup and log a message about it. -- Gregory Stark http://mit.edu/~gsstark/resume.pdf