Received: by 10.213.65.68 with SMTP id h4csp1062925imn; Thu, 22 Mar 2018 14:29:13 -0700 (PDT) X-Google-Smtp-Source: AG47ELtVW7VoCWlXDOspZ12RELlhVIbU0cNifHlVcq9wiaQulcTOXa80DLORVeHctrln+1i8CIjC X-Received: by 10.99.156.17 with SMTP id f17mr18993600pge.102.1521754153231; Thu, 22 Mar 2018 14:29:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521754153; cv=none; d=google.com; s=arc-20160816; b=jLDbEve6n986dlP6g9i0gSB/h+2O1UT9IXOLJQ4wJDguaWXAwCOxyf8jCdgk/8T4Be xkI9O4svaKmGHnBwPg2b5Xda514zGORF/Sey3HjmTBOeRIoy2Z8zAYpkhkTuqDQ2v9JQ N/LFxQMgTnrkWNqNOYxhc8Ml26j2nut/cWTkYBFjuW5weQTS8MhP/jjmcU2kmqXqfSjb MdBEWwy60Yy6st/4HB15/NeFsIN8mSZ3u2/0aQnQPYJxzLhX+xGejUnb7TqCdJYCrPvA j+4t4gaScJLNhew8d8ubSS6HUcQt4j43SY7YXUjblik+n1ShcQoxuFjaSNicqIVIj1iv P/eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature:arc-authentication-results; bh=lyMkzjo9d72aHge7nUIPAYo80emuX6Ccoa7MqPysHE4=; b=MUVYsAwUp896j516bbsLireFaRwvrbVxJ4I1yX+Y6jeaaHfNE2bY2HhSdUWvr5VcvP CgzwyrG5IKYyY6cuxCpEogbT/sMjE2L3KJOZSMErvV2SXFas9bLmqraNOhlHdi9GoTyl oDk33PpZGV98Z79qJhCR4+YkkPCrPQDvTN3dh4hRc4foOZTHd1OvkGCwfruiZuuvYvIH jwBvdELzMScAPsiJxYGer/NPOUlaXWZN+UOftEFewKb4dN4oP+fjAzp6wDfbg2ownnkd D14qaHpicVDf0NEqFDrrO4bZ++U8G54lrgNsn5TpWK4FzfYvDm1vKhQOQBrxlhBCPJgD VQ6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=aDJzFVYz; dkim=pass header.i=@codeaurora.org header.s=default header.b=H0dGpdVE; 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 m9-v6si6844128plk.464.2018.03.22.14.28.58; Thu, 22 Mar 2018 14:29:13 -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=@codeaurora.org header.s=default header.b=aDJzFVYz; dkim=pass header.i=@codeaurora.org header.s=default header.b=H0dGpdVE; 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 S1751797AbeCVV2C (ORCPT + 99 others); Thu, 22 Mar 2018 17:28:02 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:32912 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751595AbeCVV2A (ORCPT ); Thu, 22 Mar 2018 17:28:00 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 916E360F61; Thu, 22 Mar 2018 21:27:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521754079; bh=4wj0+9BXe3eOhdVdupq911SX3fUryItLOwWgRYGsI20=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=aDJzFVYzd8Ym/0cWG42ALJJcfZ9mqUiQGmNTAvhfnEJgeI8vcAPTo9YxXK1PBDfKF VNC8tn8uTDMyKGxVG5BJYKAAikB8qm4Q6CmSKz7XeDGSq2AQ2rHwzQkURaM7hatTxI 001niA1oGvTdU+ctcmRnrkB+XE2xmlSF+1SbSukg= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [10.235.228.150] (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: okaya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 3333260128; Thu, 22 Mar 2018 21:27:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521754078; bh=4wj0+9BXe3eOhdVdupq911SX3fUryItLOwWgRYGsI20=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=H0dGpdVElBs3HdtcSXAl2NgmLYqqmjYHZq8a/4+D7FJj9vtgMSBfcKn0Z86heJDFt h1DPdigI/h3f6brMimpJe8UylnjD/b8sj+KfPOcj+zyslm8E+FI5BxiECz7LO2ghpg UXFymX1VNvokLav5Qo5MLCjr9TOn/QAKEupjW1gg= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 3333260128 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=okaya@codeaurora.org Subject: Re: [PATCH v4 4/6] infiniband: cxgb4: Eliminate duplicate barriers on weakly-ordered archs To: Casey Leedom , Jason Gunthorpe Cc: SWise OGC , 'kbuild test robot' , "kbuild-all@01.org" , "linux-rdma@vger.kernel.org" , "timur@codeaurora.org" , "sulrich@codeaurora.org" , "linux-arm-msm@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Steve Wise , 'Doug Ledford' , "linux-kernel@vger.kernel.org" , Michael Werner References: <1521514068-8856-5-git-send-email-okaya@codeaurora.org> <201803221430.P43GJl9U%fengguang.wu@intel.com> <3664b253c730dbf83f4528acaedb3a88@codeaurora.org> <3e9c006e4541acbce11743dbda553e84@codeaurora.org> <03d201d3c1eb$b71fb460$255f1d20$@opengridcomputing.com> <83484a3f-d3f7-d763-e4f8-e4fec3bb8cc2@codeaurora.org> <52cbc9d7-5a6b-5c8b-b930-058f5be62079@opengridcomputing.com> <20180322201649.GC9469@ziepe.ca> From: Sinan Kaya Message-ID: Date: Thu, 22 Mar 2018 17:27:56 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/22/2018 4:45 PM, Casey Leedom wrote: > Yes, but ... > > For instance, I see that the x86 writel() has "memory" in its asm(), which > prevents GCC from reordering generated instructions. And it ~looks like~ > arm64 ~sort of~ gets that with the inclusion of __iowmb() (which translates > to wmb() then dsb(st) which finally holds the GCC "memory" barrier). Is > this part of the documented semantic of the writel_relaxed()? The PowerPC > stuff simply defines writel_relaxed() as writel() and I can't find the > bottom of that Rabbit Hole ... > This is changing. See "RFC on writel and writel_relaxed" thread. PowerPC maintainers are looking for a way to implement this. What matters is the description in the barriers document. See also section "MMIO access primitives" here about mmiowb() https://lwn.net/Articles/697539/ > I'm guessing~ that this line in the documentation ~may~ imply the GCC > ordering: > > ... Note that relaxed accesses to > the same peripheral are guaranteed to be ordered with respect to each > other. ... > This can be a compiler barrier for some arches and/or can be architecturally guaranteed as in ARM64's device nGnRE mapping (non-gathering non-reordering with early acknowledgment). Both writel() and writel_relaxed() need to guarantee ordering with respect to what HW observes for writes. They have different guarantees regarding the code surrounding write like you identified. > In any case, we really only have a few places where we (the various Chelsio > drivers) need to worry about this: the "Fast Paths" where we have a lot of > I/O to the device. I think we should leave everything else alone. makes sense > > Casey > -- Sinan Kaya Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.