Received: by 10.213.65.68 with SMTP id h4csp3921141imn; Tue, 3 Apr 2018 13:05:25 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/SmwqfbJHtwtHLPhehep4y4NTbrOPaEq2G6jr+TSkolGkwasxbghPBLq/8LfnCC3G4dqaa X-Received: by 10.98.61.206 with SMTP id x75mr11539977pfj.233.1522785925528; Tue, 03 Apr 2018 13:05:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522785925; cv=none; d=google.com; s=arc-20160816; b=QSLsHt6boUG1W3j5/Q3YqgkKTUmmO1CtUh3mRuzOOOMZOuALZJFocHBxr0av8+X903 7DVOgXorb+21Rh9w7XDqaamc2fLX5+88Ctgt21H+JCpEOH1wKuxeE77nVg14uhucrorg vTR3ZG2B3DtN0fnd/KOB2MLOnR6w4Eo8OsilshPh8glLIEPVyvHbZF5OrWpGdokOk/zR c5BRyIcExrmGyOBTgmgUG7EoHO82Jkul2tfN2XRofzDT3+z/R0RfG9Dbv6+1vptMZL0m +BTOzFImFZK0l4V1Lnpe4tD3eVq88a86rR/zvgRUHPqkWePcwuJ7f7ZH0ZV6Kj9bgTYI Sn/w== 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=oqX7fe1li8s4MQskBfqIeF4hoGHnfbBznbHIzs12ebE=; b=W1sR8GqeXzMG3ivUZH+xxYC8sI4J/bnJxhzNnbNNx+z/Ei0rPZfiH66oFR33fxRCKD 6WtG5EjxdtyiqnT4tcpwJhVJr3DKuKzOoz/Y3tLX5DYNCUSxG8ZGMoHP5OBzgYreY3ga /ZPKQ6WuK34WA02BKuA5sc5Bw8qKSUP9/+cVMxHRxvSdAvoCQmGqWhnZ4Tmr3eXTVQAs zuoKuxCrRim0ik0Qws/ysobkAEVa6M/dFLVHDPd6GJwF6XRVrL4uxJRjiT7AeMXm79au WMpP4nBHxj2g+cQZUlaMiTcoXfdDOBHZcy2H6KhjJGUGwAmecFmeNNYdPCOJTz+jvl3y PdVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=URjstf56; 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 v6si2419601pgq.227.2018.04.03.13.05.08; Tue, 03 Apr 2018 13:05:25 -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=URjstf56; 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 S1752639AbeDCUD4 (ORCPT + 99 others); Tue, 3 Apr 2018 16:03:56 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:52682 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751179AbeDCUDy (ORCPT ); Tue, 3 Apr 2018 16:03:54 -0400 Received: by mail-wm0-f67.google.com with SMTP id g8so12147923wmd.2 for ; Tue, 03 Apr 2018 13:03:54 -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=oqX7fe1li8s4MQskBfqIeF4hoGHnfbBznbHIzs12ebE=; b=URjstf56U7sDRh+QUofj/aDci6nET5JTC8LBUNM0p9Frf3BGqemLkDmjKslLRzyYg8 Xh/Fa26OINC0Q08uBkFeTaMyORfm4/KlrQTDFVifP19HYg189JUMQNKsQLEnFSl6QZE4 xyUNCrr2AdRrt+9aqUpVhKvgXp5SEDXJkTgyCAezhEqyDU5r49Ln+4CmYkzcKC3rJfPZ 9rzH2Ot/lc4tebeeV8qvhSveFVgE4K83+skDNlq3U9mT6P6S/N45Qva9zZ5LC5uKKHhR CkuZDNJSFAcSJNSmdWD3xkh6zTdUsqoftgRjynuJQSinC+dnXNFCmwq1uFapHHaUE3+F zXmQ== 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=oqX7fe1li8s4MQskBfqIeF4hoGHnfbBznbHIzs12ebE=; b=I0qUITB3N5UdAsaC9jZ+1s861Os7lhtpqvWrdAywkIKcpX8xDSerl8NM7CUm3p0XJx X6a7/vxszn1uWL23klkDU3BJjLsIHoPcKUoCgzBrDjw32ufRd7MqMKPWDMvUbmKH1u5/ BOAmIrsN1yhE8/4MK7s8vz0XLVONXVus3QQDUtsuwTGi8sdeQmBzolKSZwa+uHRLm58l 4OBIZ3ndouRAj7+xMlBBoXYhAjLLxrNxwq9a92eMrlWSt7lKhSUyfUBX1GC64wrf2xaP I2X7nsms4WQERBvhLWvYiEZexSiQiIvHRzer4ngLUkx2rdWG3hgk7L4QqNIzdPrukpEZ z1cA== X-Gm-Message-State: AElRT7FAvJ1MxhwQoQylpd/t9uuDgZhu622rfMSuCiA3IX01kL9c/iAR s4Sv2yIkXzZJ+ULBJbVww/NIIA== X-Received: by 10.28.40.194 with SMTP id o185mr4807735wmo.111.1522785833664; Tue, 03 Apr 2018 13:03:53 -0700 (PDT) Received: from ziepe.ca (S010614cc2056d97f.ed.shawcable.net. [174.3.196.123]) by smtp.gmail.com with ESMTPSA id k10sm2013342wmb.26.2018.04.03.13.03.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Apr 2018 13:03:52 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.86_2) (envelope-from ) id 1f3S9k-0000I1-Ti; Tue, 03 Apr 2018 14:03:48 -0600 Date: Tue, 3 Apr 2018 14:03:48 -0600 From: Jason Gunthorpe To: "Kalderon, Michal" Cc: Sinan Kaya , "linux-rdma@vger.kernel.org" , "timur@codeaurora.org" , "sulrich@codeaurora.org" , "linux-arm-msm@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "Elior, Ariel" , Doug Ledford , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v5 3/3] RDMA/qedr: eliminate duplicate barriers on weakly-ordered archs #2 Message-ID: <20180403200348.GB21167@ziepe.ca> References: <1521736009-23387-1-git-send-email-okaya@codeaurora.org> <1521736009-23387-4-git-send-email-okaya@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Tue, Apr 03, 2018 at 07:42:28AM +0000, Kalderon, Michal wrote: > > From: Sinan Kaya [mailto:okaya@codeaurora.org] > > Sent: Tuesday, April 03, 2018 5:30 AM > > To: linux-rdma@vger.kernel.org; timur@codeaurora.org; > > sulrich@codeaurora.org > > Cc: linux-arm-msm@vger.kernel.org; linux-arm-kernel@lists.infradead.org; > > Kalderon, Michal ; Elior, Ariel > > ; Doug Ledford ; Jason > > Gunthorpe ; linux-kernel@vger.kernel.org > > Subject: Re: [PATCH v5 3/3] RDMA/qedr: eliminate duplicate barriers on > > weakly-ordered archs #2 > > > > On 3/22/2018 12:26 PM, Sinan Kaya wrote: > > > @@ -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); > > > > Given the direction to get rid of wmb() in front of writeX() functions, I have > > been reviewing this code. Under normal circumstances, I can get rid of all > > wmb() as follows. > > > > However, I started having my doubts now. Are these wmb() used as a SMP > > barrier too? > > I can't find any smp_Xmb() in drivers/infiniband/hw/qedr directory. > > Your doubts are in place. You initial patch series modified writel to writel_relaxed > Simply removing the wmb is dangerous. The wmb before writel are used to make sure the > HW observes the changes in memory before we trigger the doorbell. Smp barriers here > wouldn't suffice, as on a single processor. we still need to make sure memory is updated > and not remained in cache when HW accesses it. > Reviewing the qedr barriers, I can find places where this may have not been necessary, > But definitely you can't simply remove this wmb barriers. As Sinan said, the consensus is that wmb();writel(); is redundant if the only purpose of the wmb is to order DMA and system memory. So can you review these patches on that basis please? Is the WMB doing something else, eg SMP related? If yes, please send a patch adding appropriate comments. Thanks, Jason