Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 26AD116B0CAC for ; Mon, 19 Dec 2011 12:09:35 -0400 (AST) Received: from exprod7og103.obsmtp.com ([64.18.2.159]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RcfmN-00034t-C4 for pgsql-bugs@postgresql.org; Mon, 19 Dec 2011 16:09:35 +0000 Received: from mail-ee0-f53.google.com ([74.125.83.53]) (using TLSv1) by exprod7ob103.postini.com ([64.18.6.12]) with SMTP ID DSNKTu9hrqBH/jkrwDnqh7VTpZoEByBVvkqZ@postini.com; Mon, 19 Dec 2011 08:09:31 PST Received: by eekd41 with SMTP id d41so5571939eek.40 for ; Mon, 19 Dec 2011 08:09:17 -0800 (PST) Received: by 10.14.99.78 with SMTP id w54mr4423640eef.33.1324310956248; Mon, 19 Dec 2011 08:09:16 -0800 (PST) Received: from [192.168.1.101] (dsl-hkibrasgw2-ff6cc300-200.dhcp.inet.fi. [88.195.108.200]) by mx.google.com with ESMTPS id s16sm46252564eef.2.2011.12.19.08.09.15 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 19 Dec 2011 08:09:15 -0800 (PST) Message-ID: <4EEF61A9.1060608@enterprisedb.com> Date: Mon, 19 Dec 2011 18:09:13 +0200 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; fi-FI; rv:1.9.2.24) Gecko/20111114 Icedove/3.1.16 MIME-Version: 1.0 To: pgsql-bugs@postgresql.org Subject: Re: [PATCH] Use CC atomic builtins if available [was: Re: TAS patch for building on armel/armhf thumb] References: <4EEB1C77.1000309@enterprisedb.com> <20111218224203.GA2950@piware.de> <4EEF5397.8090200@enterprisedb.com> <20111219153943.GK2972@piware.de> In-Reply-To: <20111219153943.GK2972@piware.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201112/157 X-Sequence-Number: 31968 On 19.12.2011 17:39, Martin Pitt wrote: > Heikki Linnakangas [2011-12-19 17:09 +0200]: >> One thing that caught my eye: if you use __sync_lock_and_test() to >> implement S_LOCK(), you really should be using __sync_lock_release() >> for S_UNLOCK(). > > Right, the patch I send does that: > > #define S_UNLOCK(lock) __sync_lock_release(lock) Oh, I'm blind... Can you comment on or test whether the existing TAS implementation is broken on ARM, because the existing S_UNLOCK() on ARM doesn't act as a memory barrier? If we're going to keep the existing snippet of inline assembly for those variants of ARM where it works, we need to either fix S_UNLOCK or convince ourselves that it's not broken. I'll take a closer look at the same on Itanium. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com