Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4635209yba; Tue, 30 Apr 2019 01:36:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqzYbJb+aTbf4H0FtGwo5rcxxd6nOurQliJ/gJmwRLZVPaty8M6ihqcZ/Hmc6oZiJ35+qWbk X-Received: by 2002:a63:6fc1:: with SMTP id k184mr65280051pgc.239.1556613365075; Tue, 30 Apr 2019 01:36:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556613365; cv=none; d=google.com; s=arc-20160816; b=R4P9ZWxiJHxU6l+qxLx6fiy66sBnDdMXptuHzc7Zx4ly7eGA35fw60KMi764t4knGg Zkcc9tZHkzYCOWwYf25EKBZX0b6Lc3jQMmmb6X9qoRbxVSBxC3vpxNDW8qY1qmLqqvzC I9nzd2P8qyQ24ApuAeTB+SihR5pXKugQXP3cKZCJ0whFyvU0HpN1zrNqF//cXaCO6qwH pSjkcBwcQX7YQ/YH5ynf/SGQUae90/zfrfUAI88cgZsblZobFAGLKCQEMsZDJL4o+7LW 9Y1BAbPsnSUaArKuWM+tuCdR2U7V1E/h46d+7h81WSMGqHdIaXugPs2sgjZHhCkeDA3S SbMg== 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=V1cm2gZOz8Lo0b6Ns70mAemkxqG1bfPxARMsSFPCS1g=; b=GHeR0chfQDKhHi7++phh6VF+uu290tMZBEtGomVuAqwX9QyvXCyH43gSk+pXOxhrn7 mdb0Zv2s4x7ibkB3lMybjooHTBiwCcSwmcEifU7zO1XlDuOIgW79y2l+ioes05b2OcyY mNuNyMn5fRudRioBGkpA6mHh27PCeZ4qrNljrSISQoXUT/vpdIm/2S2STH0l6GFEKRq3 8/oHg5kzrpZZtnWLyvgWu2WMZKt1nDTk7WASZLEeZ/pd4DcPVBhL/iNfYAeAn1ctDpOm LmOXaiSGwxLFpYH6PVSVhifjD2kVzkKvddTzRXeX+CY+opxJfB0Uoi32cNJiSUW0fpb2 drrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=yyawsRFS; 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 b2si13521863pfd.268.2019.04.30.01.35.49; Tue, 30 Apr 2019 01:36: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=@infradead.org header.s=merlin.20170209 header.b=yyawsRFS; 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 S1726725AbfD3Iee (ORCPT + 99 others); Tue, 30 Apr 2019 04:34:34 -0400 Received: from merlin.infradead.org ([205.233.59.134]:34154 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726012AbfD3Iec (ORCPT ); Tue, 30 Apr 2019 04:34:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=V1cm2gZOz8Lo0b6Ns70mAemkxqG1bfPxARMsSFPCS1g=; b=yyawsRFSctGJbp5kerTV0THbV hgDUOIPI6GZCmUnowsm0OxIOr0+iYwProTLc4IzyicgxqZcJbMCsVSndTZwimpj6xDrZO71dPcFcc xPQPnTCuw7OvOWaJsRgaarhmAL/eDq2sx9UcdTW3TpIBa9pQxMZ552jeP96SCWsqRtJxNnI5VyYCD iSHj5ogukm+xo7h3qAFQxd/ZkKQJmdfahuer5JDRpWeF9vBATiPbWG76BCIlWzxn80Z80PWjOiB/J uaa9WMvq/JQLyMv5+9DosCkMUkx/B4YpHFL9SyxHFyMZ9VDVE1bu4Fion/TKPMdWRGobXfUhokbXm 1+OzT5X7g==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hLODK-0007XM-I8; Tue, 30 Apr 2019 08:34:10 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 5182E29D2D6D8; Tue, 30 Apr 2019 10:34:09 +0200 (CEST) Date: Tue, 30 Apr 2019 10:34:09 +0200 From: Peter Zijlstra To: Andrea Parri Cc: linux-kernel@vger.kernel.org, "Paul E. McKenney" , Rob Clark , Sean Paul , David Airlie , Daniel Vetter , Jordan Crouse , Jens Axboe , Omar Sandoval , "Yan, Zheng" , Sage Weil , Ilya Dryomov , Dennis Dalessandro , Mike Marciniszyn , Doug Ledford , Jason Gunthorpe Subject: Re: [PATCH 0/5] Fix improper uses of smp_mb__{before,after}_atomic() Message-ID: <20190430083409.GD2677@hirez.programming.kicks-ass.net> References: <1556568902-12464-1-git-send-email-andrea.parri@amarulasolutions.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1556568902-12464-1-git-send-email-andrea.parri@amarulasolutions.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 29, 2019 at 10:14:56PM +0200, Andrea Parri wrote: > Hello! > > A relatively common misuse of these barriers is to apply these to > operations which are not read-modify-write operations, such as > atomic_set() and atomic_read(); examples were discussed in [1]. > > This series attempts to fix those uses by (conservatively) replacing > the smp_mb__{before,after}_atomic() barriers with full memory barriers. I don't think blindly doing this replacement makes the code any better; much of the code you found is just straight up dodgy to begin with. I think the people should mostly just consider this a bug report. Also, remember a memory barrier without a coherent comment is most likely a bug anyway.