From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40974Y4x0YzF25W for ; Tue, 27 Mar 2018 08:46:04 +1100 (AEDT) Message-ID: <1522099618.7364.0.camel@kernel.crashing.org> Subject: Re: RFC on writel and writel_relaxed From: Benjamin Herrenschmidt To: Jason Gunthorpe , David Laight Cc: Sinan Kaya , "open list:LINUX FOR POWERPC (32-BIT AND 64-BIT)" , Oliver , "linux-rdma@vger.kernel.org" Date: Tue, 27 Mar 2018 08:26:58 +1100 In-Reply-To: <20180326165425.GA15554@ziepe.ca> References: <3611eabe-2999-1482-b2b4-6d216bbe4762@codeaurora.org> <4e5c745a-8b9b-959e-8893-d99cd6032484@codeaurora.org> <1521692689.16434.293.camel@kernel.crashing.org> <1521726722.16434.312.camel@kernel.crashing.org> <20180323163510.GC13033@ziepe.ca> <1521854626.16434.359.camel@kernel.crashing.org> <58ce5b83f40f4775bec1be8db66adb0d@AcuMS.aculab.com> <20180326165425.GA15554@ziepe.ca> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Mon, 2018-03-26 at 10:54 -0600, Jason Gunthorpe wrote: > On Mon, Mar 26, 2018 at 11:08:45AM +0000, David Laight wrote: > > > > This is a super performance critical operation for most drivers and > > > > directly impacts network performance. > > > > Perhaps there ought to be writel_nobarrier() (etc) that never contain > > any barriers at all. > > This might mean that they are always just the memory operation, > > but it would make it more obvious what the driver was doing. > > I think that is what writel_relaxed is supposed to be. > > The only restriction it has is that the writes to a single device > using UC memory must be kept in program order.. Which requires barriers on some architectures :-) Also we don't have a clear definition of what happens on WC memory. Cheers, Ben.