Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 2DDB6131F6D0 for ; Fri, 16 Mar 2012 06:46:04 -0300 (ADT) Received: from exprod7og107.obsmtp.com ([64.18.2.167]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1S8TjX-0003D6-0v for pgsql-bugs@postgresql.org; Fri, 16 Mar 2012 09:46:04 +0000 Received: from mail-lb0-f181.google.com ([209.85.217.181]) (using TLSv1) by exprod7ob107.postini.com ([64.18.6.12]) with SMTP ID DSNKT2MLzWoDJ/TUBQ428TBw9x4Ux5J87eIZ@postini.com; Fri, 16 Mar 2012 02:46:02 PDT Received: by lbok6 with SMTP id k6so2194164lbo.40 for ; Fri, 16 Mar 2012 02:45:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=JISuTzle4Xjg5/96WVaabrUDkV6BXbIyYRNd5m70Pg4=; b=bdEg5twphsbV8pSCKjLYLEfEnDgc23C7lieDOFFAp4v4sWQ5bf0+9j2OoS8QB093Am u4JM2mgFBkL3WhUfEyZaYLzDaP0PDOKsqjabbRUMhU+zpKbxxTCCuJGQ9YAMiW7ekNZ5 LWxkNGRXOdvcqpLMNW7E52ITCA5zNHqPv8CQNac5UFvSmpL5ON91JmXBWfvkEb+xLqEG tztRPGpYkrJ837e5s3IBHjiB99lcWaPZl1XjvldgZ9u6CitGhaZyFKSGf3yv/4NRXgN3 LyPf4c4VMo/vTGlEnk6Fxchu13NjRaDWxT1HBCJFSHEVth/2SHP35CJk1Wx4WkLfLeSr aqSg== Received: by 10.112.84.195 with SMTP id b3mr660758lbz.107.1331891147557; Fri, 16 Mar 2012 02:45:47 -0700 (PDT) Received: from [192.168.1.100] (dsl-hkibrasgw2-ff6cc300-200.dhcp.inet.fi. [88.195.108.200]) by mx.google.com with ESMTPS id v4sm5799539lbx.13.2012.03.16.02.45.44 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 16 Mar 2012 02:45:45 -0700 (PDT) Message-ID: <4F630BC0.3050903@enterprisedb.com> Date: Fri, 16 Mar 2012 11:45:36 +0200 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20120216 Icedove/8.0 MIME-Version: 1.0 To: Bruce Momjian , "Sergey E. Koposov" CC: Tom Lane , Noah Misch , Robert Haas , PostgreSQL Bugs Subject: Re: 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> <20111219200341.GB9495@tornado.leadboat.com> <14852.1324325578@sss.pgh.pa.us> <4EEFABB2.5050100@enterprisedb.com> <20120203014821.GA11939@momjian.us> <4F2FB870.3060104@enterprisedb.com> In-Reply-To: <4F2FB870.3060104@enterprisedb.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQkS5WH6tidR9xSrTwp1FCJHCrQkDlj9pxdI3tTqSfxp1QOPirH6yp5lRNvJdROQtcgPvLhW X-Pg-Spam-Score: -4.2 (----) X-Archive-Number: 201203/119 X-Sequence-Number: 32680 On 06.02.2012 13:24, Heikki Linnakangas wrote: > On 03.02.2012 02:48, Bruce Momjian wrote: >> Sorry for the late reply, but Heikki, can you get this Itanium >> information into s_lock.h as a comment, particularly the information >> about the +Ovolatile=__unordered flag? > > Good idea. I came up with the attached, hope that explains it. Committed these additional comments. > Looking back at the discussions, we concluded that the current code is > safe on gcc, because it implicitly adds the .rel/.acq opcodes to > volatile accesses, and HP's compiler does the same as long as you don't > explicitly disable it with +Ovolatile=__unordered. But what about > Intel's icc compiler? Presumably it's also safe, but looking at Intel's > manuals that I found, I'm not completely sure about it. There's an > option, -m[no-]serialize-volatile, that controls it, but I couldn't > figure out which is the default. Looking at the docs on that from Intel > that I found [1], it seems to me that on Linux, the default is *not* > safe, but on Windows it is. > > Sergey, you have dugong in the buildfarm that uses Intel's compiler on > Itanium. Could you verify whether the -mno-serialize-volatile is the > default? If you could for example extract the assembler code generated > by icc for xlog.c, and send it over. Whether it's generating the > .rel/.acq opcodes should be easy to see in the generated code of the > XLogGetLastRemoved() function, for example, which doesn't do much else > than grab a spinlock. On gcc, the -s flag generates the assembly files, > I presume it's the same on icc. Sergey confirmed off-list that icc defaults to -mserialize-volatile, so we're safe. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com