Received: by 10.213.65.68 with SMTP id h4csp482194imn; Tue, 20 Mar 2018 07:57:02 -0700 (PDT) X-Google-Smtp-Source: AG47ELuAYpau16HlXZqPA+fEFPbD7Stk9ofAlwtTQFJl1Aalo9WWfgqQrrrKaeVrBtiBlJT08CaY X-Received: by 2002:a17:902:8206:: with SMTP id x6-v6mr10056930pln.256.1521557822239; Tue, 20 Mar 2018 07:57:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521557822; cv=none; d=google.com; s=arc-20160816; b=ijoEQJiJkWhnTsoM41Bk1iZhPKx4W4pwP1Z0M5iYYO4psw6cgWR+yEi443GpX87JJC t43uL3b1h4SAvVYBTBwaE8tt3EHh2/2kJSQsl/cniDLpfcYtwYPrl1vB6o0a2b11vD4G loRYFSVdArgCPLjvWrzrt9NkHSpWXv80ILbKxkweHLro0CuL5faP5J0nY0Id4GwsuEb5 iLmIvfLF666EzRfoH8qWGWBnm65SCClPAEPXmeuGKsP/+shWtrbFmRX3YBLfw3vJS3h0 mvYC7oKJyRH3ZBFS5Cco9A7ZdegA2Rw5t2JibwgKOlr/OhtTvpKhMax1eOV1HHSrTbwG eUoA== 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=F6zoblvZJphMSYVjfXCPeM2KGYOoJjWHy3gnr6DQsEw=; b=ZMVDBMdi3uu1VQ2WUY8oquKDlgXs0taWR5hV7WKmwMl5z4ih7Q1wBioq4SofaJcO7W QCLfvfO4O/9xAWF/9pMfbTat7hTnBfimGxdOTspjfoA0IlIQZFRzJx8PgfYopHAhU+RV g0agMS/drGh71T1uam+PPeAcQldMmnqmPlGvDSsI5fbnjtBxJD2kqbhDAMwn+bJhzqrF c2sCggEhdT8v8t0hovEOMLyd++5FyFc7Ah/baievOdBUos0qj8zcgkxIf4F0GxTU+xVP ckhsESMFzQghIRCCvERlgQviRu2FNB1+Ldg5fjNALu4wwLYe35NO7OA+pcLSGLBIRLZD 7x8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=iCghahZ1; 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 g17-v6si1742537plo.486.2018.03.20.07.56.48; Tue, 20 Mar 2018 07:57:02 -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=@ziepe.ca header.s=google header.b=iCghahZ1; 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 S1751539AbeCTOze (ORCPT + 99 others); Tue, 20 Mar 2018 10:55:34 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:45210 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750991AbeCTOzb (ORCPT ); Tue, 20 Mar 2018 10:55:31 -0400 Received: by mail-wr0-f196.google.com with SMTP id h2so1991816wre.12 for ; Tue, 20 Mar 2018 07:55:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=F6zoblvZJphMSYVjfXCPeM2KGYOoJjWHy3gnr6DQsEw=; b=iCghahZ1BR7erudFZCagkA6+FvSRIQi0yfWl6Jm6yQXTFVUgp0tTMrbj6/zbGzG4Yq DoOFyrv+uXUpfbvXwSYx/X4ujhFAotswOba8FXNs4Y/2jbZ1z8IOjbVfMM2fkQuckFCj I8/k4TOIRNkiZwdYQZJs6HHi6cPZfTnjvrdBrfRGpIgS6C6kg9yvqJTFjF6Pyc9AaUol 2Kt/LHyNtcs+WvT5heZTlfJJbRQBqkKFtaEWhAJPVf32JDnw7GeUtnOMRiZQ6gA9ttnE 4aUhwoah5kgeYCbc1rZc90niK5RKzGcPrZK+1oLZIRJobms659GOeLURkqWB3Q3vks5f h5Mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=F6zoblvZJphMSYVjfXCPeM2KGYOoJjWHy3gnr6DQsEw=; b=ivTeGLVtuG9znRBr9qW5RPvyAd7UNi56lTTfGLgULeHriCxEIMJQOiKoXxEvQ5Gb7S BZbpoz9Y+vs3d7FSEXgfJasr61jFRv3u8KHJMzLh9akKFy92jKL0LAUG6tFqjVk2DguD D41f9U1BNBqbc/st1mJr741+7v1k4ux2O1Bd8PLxUB3ry56+yv0X8kZXdVCF11V3tX2P 88/8lI1mD2XzMGoZHWx+6BfAAzevndS9oTb3DWAU3VxNE/5/5qREsZ4xULI9DxSvM5f7 i/fYHvDZ9Hga95tk2HafpHDTblLEJOCq2NWHOYkr1TLY3vDHJYOD4Zsr6aSHerQw0yS5 bbOA== X-Gm-Message-State: AElRT7HSAfsbliPctnYAm68IfSOEm8+mgamkn7Qt0l/Xvvk62V3jEB0U WDZ3R6Y/74oo4aXFVqfaqf7zfA== X-Received: by 10.223.181.152 with SMTP id c24mr14049102wre.233.1521557730337; Tue, 20 Mar 2018 07:55:30 -0700 (PDT) Received: from ziepe.ca (S010614cc2056d97f.ed.shawcable.net. [174.3.196.123]) by smtp.gmail.com with ESMTPSA id k130sm2043417wmg.9.2018.03.20.07.55.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Mar 2018 07:55:29 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.86_2) (envelope-from ) id 1eyIfe-0006CB-3r; Tue, 20 Mar 2018 08:55:26 -0600 Date: Tue, 20 Mar 2018 08:55:26 -0600 From: Jason Gunthorpe To: Sinan Kaya Cc: linux-rdma@vger.kernel.org, timur@codeaurora.org, sulrich@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Michal Kalderon , Ariel Elior , Doug Ledford , linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 6/6] RDMA/qedr: eliminate duplicate barriers on weakly-ordered archs #2 Message-ID: <20180320145526.GI19744@ziepe.ca> References: <1521514068-8856-1-git-send-email-okaya@codeaurora.org> <1521514068-8856-7-git-send-email-okaya@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1521514068-8856-7-git-send-email-okaya@codeaurora.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 19, 2018 at 10:47:48PM -0400, Sinan Kaya wrote: > Code includes wmb() followed by writel() in multiple places. writel() > already has a barrier on some architectures like arm64. > > This ends up CPU observing two barriers back to back before executing the > register write. > > Since code already has an explicit barrier call, changing writel() to > writel_relaxed(). > > Signed-off-by: Sinan Kaya > drivers/infiniband/hw/qedr/verbs.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/infiniband/hw/qedr/verbs.c b/drivers/infiniband/hw/qedr/verbs.c > index ccd55f4..db60360 100644 > +++ b/drivers/infiniband/hw/qedr/verbs.c > @@ -860,7 +860,7 @@ static void doorbell_cq(struct qedr_cq *cq, u32 cons, u8 flags) > wmb(); > cq->db.data.agg_flags = flags; > cq->db.data.value = cpu_to_le32(cons); > - writeq(cq->db.raw, cq->db_addr); > + writeq_relaxed(cq->db.raw, cq->db_addr); > > /* Make sure write would stick */ > mmiowb(); > @@ -3338,7 +3338,7 @@ int qedr_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *wr, > > qp->rq.db_data.data.value++; > > - writel(qp->rq.db_data.raw, qp->rq.db); > + writel_relaxed(qp->rq.db_data.raw, qp->rq.db); > > /* Make sure write sticks */ > mmiowb(); Looks fine, but the next lines should be relaxed too: /* Make sure write sticks */ mmiowb(); if (rdma_protocol_iwarp(&dev->ibdev, 1)) { writel(qp->rq.iwarp_db2_data.raw, qp->rq.iwarp_db2); mmiowb(); /* for second doorbell */ } mmiowb() is strong enough to order writel, IIRC. Jason