From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCHv2 4/6] x86: provide xadd() Date: Thu, 16 Apr 2015 13:00:54 +0100 Message-ID: <1429185654.25195.119.camel@citrix.com> References: <1428675597-28465-1-git-send-email-david.vrabel@citrix.com> <1428675597-28465-5-git-send-email-david.vrabel@citrix.com> <20150416112556.GI13443@deinos.phlegethon.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YiiUQ-0005EK-Qq for xen-devel@lists.xenproject.org; Thu, 16 Apr 2015 12:01:50 +0000 In-Reply-To: <20150416112556.GI13443@deinos.phlegethon.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Tim Deegan Cc: xen-devel@lists.xenproject.org, Keir Fraser , David Vrabel , Jan Beulich , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Thu, 2015-04-16 at 12:25 +0100, Tim Deegan wrote: > But also: AFAICS the GCC builtin __sync_fetch_and_add() does almost > exactly this (the difference being that those are also compiler > barriers where this is only a CPU barrier). Should we be using it > instead? In general I'm of the opinion we should, because it makes my life easier on ARM (and perhaps we should trust compiler folks...) Big question though would be when it became available in gcc. I think that's generally why Linux hasn't switched in many cases, or perhaps (historical?) concerns about whether they are optimal enough. Ian.