Received: by 10.192.165.148 with SMTP id m20csp2747710imm; Sun, 6 May 2018 23:52:06 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpUUzNMJjv5c2ObIiND7ghTyBJf6HSbCAAoqW+Oquhg1gGsExd7kprQWsCChuaZVVxsl80e X-Received: by 10.98.251.20 with SMTP id x20mr35784930pfm.48.1525675925976; Sun, 06 May 2018 23:52:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525675925; cv=none; d=google.com; s=arc-20160816; b=KtIXIQEtU5H5sbdldJLzxSEFv8+c1WclMM8PWTLkQJI6gxkIwEWt3Y8YJRd9ah4PRk wQEJ0TDQ/3MPK8jrhsZwmkLerG+DHGjCS4h9UpjTHFB+VEFs3V4DimyETqau4zqAhMY6 KxdPxs7x+NViV8ETAfQqDuLV342K42qzyU0LHqerRVwp+ZX1YobAEGGo0jwFLJsSCdC9 ExTY5P7M7hKmWSIORu69O4bMLtpDBIAUbibLDop5dSsgduVMJzJJ9DwNJlOpvnqz7aTw nX5SYiYJD8MbUnRvsIPeSZGtP8z/xgY38NBpGHjbreLmx7TOfcdUM1ztBGg9N6OcVfCH hwkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=JjRkiBXUnI02ZcgPyQ8Dvy14wk7mGTGof7RR6PXPizE=; b=ncp5uC/BXCIDEXwf51yS4rDlYWZvx59/hNBYV5Adk5anudY+MMUGqiTTM/gpNHHEeq nWctF5qZViUVvqE91f55xzvsYeEw7WlZ8Hudp0qiQxzH+yyblGZluD8sLpyCGhyEAWan ge6qUtjrDgxmTAiCST4LOElBjqQcWFlL8Xsx5GHp09xd5apEuGZw7YzOA7CbFO7qCngN LT5xaydNY3GRAYI4g3taYXaoIZPxIbbSeUM4FBDrJgicv1cWZ6H+cFn4ESBm5ZjaTWps 96ru9yI7g8ALHQoBF0w68VeUXFXlueItuIvebdRPZngKGiGpzG3omsvku3nEXM6WwZKv 2zJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=c+KWZNoa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f25-v6si7246799pge.60.2018.05.06.23.51.50; Sun, 06 May 2018 23:52:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=c+KWZNoa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751149AbeEGGu2 (ORCPT + 99 others); Mon, 7 May 2018 02:50:28 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:41807 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750937AbeEGGuZ (ORCPT ); Mon, 7 May 2018 02:50:25 -0400 Received: by mail-wr0-f195.google.com with SMTP id g21-v6so27502693wrb.8 for ; Sun, 06 May 2018 23:50:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=JjRkiBXUnI02ZcgPyQ8Dvy14wk7mGTGof7RR6PXPizE=; b=c+KWZNoak2JNzGDXJi4IjdLpTNM7QLlWYGXfz2DDpOoo6cslpMH6rgxJgmyX0eK0+d 7M1TrJK7sFklH/Nc4mK2LSwpHqHySwLMNpS36wcWh6ZQoS0qwkrbHIU5x6TR7W2D6Dsb +D/6GzQCWGI3QRlkcmNfLcRzeZnbhUbEQMn0xRPQ5rLcpVH0wk7MBHorobLJ8dUA6jMP W86JK8obud9sACSpFv7i9QSexBxF30O0ZyMy54x4k+tEHW8Nnc3/y87/adjneyu1C7YL eKe4RGMJQDhSK02LOPswz5tyhvmX9jLdTKDaY5BUsRlr+oXCfSOo98OpEESRHeJDFIzI 8pyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=JjRkiBXUnI02ZcgPyQ8Dvy14wk7mGTGof7RR6PXPizE=; b=GaTvhcYiAv9YS6NubHWdOHzoZQgt0sZ497OCFQVHyPCX7tm6ELr240Yy0XMX2h/psy WpvNK0ANqolCYx8ADcq3X6Yzkwfm7tvfrugaLdx66BAjNtL3i2ZVSwGvoENCqD33Q8QN gVYsZDAAY1zRbbBLuM2eromg4httvxR4v3ZFSri3OahkU+OCEC0tyLYwKU9M9usWbzka V57ASORDPlWdG87WpPGtE7x1HIp27UmE7h2OADvcMppxy9gRXi27E3Cgtrkt/lI+ITCn 5iK6S5ZI2CcLKvzG6duTZfUJryJ2g6h95MAR5sVYGzG8wdWpOWOvyKg1y3DfrI5UrHRh T1zg== X-Gm-Message-State: ALQs6tD/CHvMkEGql+ooYWqlrq5cEkfoXInSybDdbbL1rJwOz3dMwxQp oL79hiI5wQmeVWrz/RqNKhb8Xw== X-Received: by 2002:adf:8584:: with SMTP id 4-v6mr31961496wrt.15.1525675824570; Sun, 06 May 2018 23:50:24 -0700 (PDT) Received: from gmail.com (2E8B0CD5.catv.pool.telekom.hu. [46.139.12.213]) by smtp.gmail.com with ESMTPSA id d54-v6sm30518904wrd.94.2018.05.06.23.50.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 06 May 2018 23:50:23 -0700 (PDT) Date: Mon, 7 May 2018 08:50:21 +0200 From: Ingo Molnar To: Boqun Feng Cc: Peter Zijlstra , Mark Rutland , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, aryabinin@virtuozzo.com, catalin.marinas@arm.com, dvyukov@google.com, will.deacon@arm.com Subject: Re: [PATCH] locking/atomics/powerpc: Move cmpxchg helpers to asm/cmpxchg.h and define the full set of cmpxchg APIs Message-ID: <20180507065021.s63ndzpjq4pg4a74@gmail.com> References: <20180505084721.GA32344@noisy.programming.kicks-ass.net> <20180505090403.p2ywuen42rnlwizq@gmail.com> <20180505093829.xfylnedwd5nonhae@gmail.com> <20180505101609.5wb56j4mspjkokmw@tardis> <20180505103550.s7xsnto7tgppkmle@gmail.com> <20180505112817.ihrb726i37bwm4cj@tardis> <20180505132751.gwzu2vbzibr2risd@gmail.com> <20180505140340.uzfhoc42xvas4m72@tardis> <20180506121129.baacc4fxgr72rzex@gmail.com> <1525655045.499830.1362901928.0EBFEACA@webmail.messagingengine.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1525655045.499830.1362901928.0EBFEACA@webmail.messagingengine.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Boqun Feng wrote: > > > On Sun, May 6, 2018, at 8:11 PM, Ingo Molnar wrote: > > > > * Boqun Feng wrote: > > > > > > The only change I made beyond a trivial build fix is that I also added the release > > > > atomics variants explicitly: > > > > > > > > +#define atomic_cmpxchg_release(v, o, n) \ > > > > + cmpxchg_release(&((v)->counter), (o), (n)) > > > > +#define atomic64_cmpxchg_release(v, o, n) \ > > > > + cmpxchg_release(&((v)->counter), (o), (n)) > > > > > > > > It has passed a PowerPC cross-build test here, but no runtime tests. > > > > > > > > > > Do you have the commit at any branch in tip tree? I could pull it and > > > cross-build and check the assembly code of lib/atomic64_test.c, that way > > > I could verify whether we mess something up. > > > > > > > Does this patch look good to you? > > > > > > > > > > Yep! > > > > Great - I have pushed the commits out into the locking tree, they can be > > found in: > > > > git fetch git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git > > locking/core > > > > Thanks! My compile test told me that we need to remove the definitions of > atomic_xchg and atomic64_xchg in ppc's asm/atomic.h: they are now > duplicate, and will prevent the generation of _release and _acquire in the > new logic. > > If you need a updated patch for this from me, I could send later today. > (I don't have a handy environment for patch sending now, so...) That would be cool, thanks! My own cross-build testing didn't trigger that build failure. > Other than this, the modification looks fine, the lib/atomic64_test.c > generated the same asm before and after the patches. Cool, thanks for checking! Thanks, Ingo