Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp333839ybi; Fri, 24 May 2019 04:39:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqxNzpquExVUkdUvLxNF1c9qqMLmLq7ULVurDfPU8dgb5m5wmrR8KtC+A0cPSTePKEJY0Hlc X-Received: by 2002:a63:c02:: with SMTP id b2mr88579328pgl.5.1558697988680; Fri, 24 May 2019 04:39:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558697988; cv=none; d=google.com; s=arc-20160816; b=xO2ImymAtQcpv6kNeYiQ6rfuSuCdCONoD+DNnMLpAwOi4F1dBrlLsKWiioxGiYPFax XU1tYxydZTu+dEq/a09v7upKAPcPVTXTOnoZ+zJ7nzdnLiitejlJKQkZu2+PUHKEug1/ Izq6VjGpB2455fhWyKhMQyknBiOqEHYzbk0xk58KJv6d3dqm/Lj/e9Km8+BvNQf4ntXn 096ZoDMfhkMGZjm/noA4zo/lYOb/JmJmeh/R1zqRJ3Mo0bY8i8VJYxrew2YOII7pby6F 1xHcHZqcI2o416jmdBlvro3REccX3p6gpH3JvGalfUMIQMFt9X+KLAZ3ulNrGd8HJyfy rLKA== 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; bh=kBHDQd1gp/c1oynJWPfatmCjzywI3x8CPSccq0ldOPc=; b=M277CnPVUyO5qiTS4iTSulr2/VhkrtKdHsz08DA4yowjl8DG+/3ZiNlPkmQLRnpDvU OEru5fx5zXXtkROntsRqzavdhM3gsdSZcoipQdfRE1RnYuAZSSKe5TdL5d0OX4qKfOlj mz8OirQHeGOHMrqWqofjd5k2awG7Ow0T0yYmMk2DDfhsXASM7TJpdFkk1uOZgl6q8Kom toOT7kVF2U9KF5vPWczxiZt2y9VvipM/fsRmK8VfZ/3tn8OfqfFiNsqp+tVw6e0vlALU qdjk2p4yITm9vyaaSrTMtSzhMcPFhvWVFtKxLWsU+uXHeaV8/cRA2DAGP7kWkcVGb6/y Ku4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KVaJZM07; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m67si3667366pje.4.2019.05.24.04.39.32; Fri, 24 May 2019 04:39:48 -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=pass header.i=@kernel.org header.s=default header.b=KVaJZM07; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391106AbfEXLi1 (ORCPT + 99 others); Fri, 24 May 2019 07:38:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:36260 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390714AbfEXLi0 (ORCPT ); Fri, 24 May 2019 07:38:26 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3F8442168B; Fri, 24 May 2019 11:38:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558697906; bh=Zhhg//BfGeL3tcsPNX0Bm+RkAxei7MrcqCr6feaoOzI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KVaJZM07X99hL8TrcI1XzkxkEmHIbQl5KGD7llIQ55p0Mt+yT1jkDRIa/kfoZTOSu M7F2rqoetBBc8qMlYqr8PnT5wbki/ZMB6gFsyDDzh5cNA/3zbj0oPtWu7w/OxOn/OR yqC5FkK1qPyd0kqrkCh+0Qcx50ifKLpZbST3IJYk= Date: Fri, 24 May 2019 13:38:22 +0200 From: Greg KH To: Peter Zijlstra Cc: Mark Rutland , Andrea Parri , linux-kernel@vger.kernel.org, will.deacon@arm.com, aou@eecs.berkeley.edu, arnd@arndb.de, bp@alien8.de, catalin.marinas@arm.com, davem@davemloft.net, fenghua.yu@intel.com, heiko.carstens@de.ibm.com, herbert@gondor.apana.org.au, ink@jurassic.park.msu.ru, jhogan@kernel.org, linux@armlinux.org.uk, mattst88@gmail.com, mingo@kernel.org, mpe@ellerman.id.au, palmer@sifive.com, paul.burton@mips.com, paulus@samba.org, ralf@linux-mips.org, rth@twiddle.net, stable@vger.kernel.org, tglx@linutronix.de, tony.luck@intel.com, vgupta@synopsys.com, jhansen@vmware.com, vdasa@vmware.com, aditr@vmware.com, Steven Rostedt Subject: Re: [PATCH 00/18] locking/atomic: atomic64 type cleanup Message-ID: <20190524113822.GA32272@kroah.com> References: <20190522132250.26499-1-mark.rutland@arm.com> <20190523083013.GA4616@andrea> <20190523101926.GA3370@lakrids.cambridge.arm.com> <20190524103731.GN2606@hirez.programming.kicks-ass.net> <20190524111807.GS2650@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190524111807.GS2650@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 24, 2019 at 01:18:07PM +0200, Peter Zijlstra wrote: > On Fri, May 24, 2019 at 12:37:31PM +0200, Peter Zijlstra wrote: > > On Thu, May 23, 2019 at 11:19:26AM +0100, Mark Rutland wrote: > > > > > [mark@lakrids:~/src/linux]% git grep '\(return\|=\)\s\+atomic\(64\)\?_set' > > > include/linux/vmw_vmci_defs.h: return atomic_set((atomic_t *)var, (u32)new_val); > > > include/linux/vmw_vmci_defs.h: return atomic64_set(var, new_val); > > > > > > > Oh boy, what a load of crap you just did find. > > > > How about something like the below? I've not read how that buffer is > > used, but the below preserves all broken without using atomic*_t. > > Clarified by something along these lines? > > --- > Documentation/atomic_t.txt | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/Documentation/atomic_t.txt b/Documentation/atomic_t.txt > index dca3fb0554db..125c95ddbbc0 100644 > --- a/Documentation/atomic_t.txt > +++ b/Documentation/atomic_t.txt > @@ -83,6 +83,9 @@ The non-RMW ops are (typically) regular LOADs and STOREs and are canonically > implemented using READ_ONCE(), WRITE_ONCE(), smp_load_acquire() and > smp_store_release() respectively. > > +Therefore, if you find yourself only using the Non-RMW operations of atomic_t, > +you do not in fact need atomic_t at all and are doing it wrong. > + > The one detail to this is that atomic_set{}() should be observable to the RMW > ops. That is: > I like it! Reviewed-by: Greg Kroah-Hartman