From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C9828C4338F for ; Tue, 17 Aug 2021 12:28:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A751160F38 for ; Tue, 17 Aug 2021 12:28:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237253AbhHQM27 (ORCPT ); Tue, 17 Aug 2021 08:28:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:38260 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234866AbhHQM2y (ORCPT ); Tue, 17 Aug 2021 08:28:54 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1911B6023F; Tue, 17 Aug 2021 12:28:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629203301; bh=geigma0GEh1kh7nbZKs6FoG3y8PjVJoUk2XewbAE77w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fZN234TlSJyxnfsm69zZNuAlqAr3lp2I0aAC1hlU2HCo16Gw58H43KlDSziVtmzca 4LMdH6HOUw8+LIyW7Rmd0s9pCCL08YoWjJ7PAxZXIsJnDn7qyGnQQtZptmvKWi3BBX spvV/9oeJbyhoy5bVh+Wp9DBO9YsZ1lGkrvefDQAXgfIF628qM/LfNeVxAhofjONQw AS+fINbXHFf8zhre0/0L0ozEIxgR7vuzfPTRNq7lBfnHoB/TRBKm2eZKLeFcDuc9Wy 05g/Gsi9roF2yzxZ347ctkTW71SeJavolcLhlWPzGZq1obNurrA746BOAApikkPLZw Am+qFseWF/6tA== Date: Tue, 17 Aug 2021 13:28:16 +0100 From: Will Deacon To: "Paul E. McKenney" Cc: Alan Stern , Marco Elver , Boqun Feng , Andrea Parri , Mark Rutland , Dmitry Vyukov , kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org Subject: Re: LKMM: Read dependencies of writes ordered by dma_wmb()? Message-ID: <20210817122816.GA12746@willie-the-truck> References: <20210816145945.GB121345@rowland.harvard.edu> <20210816192109.GC121345@rowland.harvard.edu> <20210816205057.GN4126399@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210816205057.GN4126399@paulmck-ThinkPad-P17-Gen-1> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Just on this bit... On Mon, Aug 16, 2021 at 01:50:57PM -0700, Paul E. McKenney wrote: > 5. The dma_mb(), dma_rmb(), and dma_wmb() appear to be specific > to ARMv8. These are useful on other architectures too! IIRC, they were added by x86 in the first place. They're designed to be used with dma_alloc_coherent() allocations where you're sharing something like a ring buffer with a device and they guarantee accesses won't be reordered before they become visible to the device. They _also_ provide the same ordering to other CPUs. I gave a talk at LPC about some of this, which might help (or might make things worse...): https://www.youtube.com/watch?v=i6DayghhA8Q Ignore the bits about mmiowb() as we got rid of that. Will