Received: by 10.223.185.116 with SMTP id b49csp3026170wrg; Mon, 5 Mar 2018 12:43:19 -0800 (PST) X-Google-Smtp-Source: AG47ELuMpPlO3UYHUlZwFoumkkDgYunRdLBQQBM+vORbEQkLuM6S6j1irElmQN6WJ2ztEjasEW95 X-Received: by 2002:a17:902:b691:: with SMTP id c17-v6mr14221864pls.308.1520282599238; Mon, 05 Mar 2018 12:43:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520282599; cv=none; d=google.com; s=arc-20160816; b=FgHdquCFB+4E4js5A+LpFYTr7iIZA7t0UJ07pwB6pEYs8cc2CjNqyS1IKuxcEc22Q/ OZrX9oUPJa0lcdP3KBH9GuXcsGy20VTa5/+8TAHGQBXkKw6ti4uwZfGS7SzCCgX9cQEu CvhaYBkd6key3mS88BNdw5RUIGTUD4qQzPYuTWK4z8kJbKacbXSu0zmFi2j440UaLXOt pAzyPqEl6fCsceQYwzJp2b6n5q0F2UEKp0whz0DZ7pyzFBDFHG5tPgs+vlzndwyjZjL/ LnbgXJRICiLxFShfncpG4x9NFflxG8XbPKR50Ish055UD6AuBMn+5lv8UV2A0Ixp8q4x 1ADg== 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:arc-authentication-results; bh=daF9x8IPagvjrdl0Ato23kAquEmLwSxb73TivkkeQUM=; b=X+iMmAv4DC4m7n7WK0mVV1WFla15u95U6sFPVfxHUmJmJfryPw0tUDdmotI5AnoHCG kGDVbLGSsEFbp1chihyTkOW1FBLUn7WwcDK0MqD3yB7RXF81CtanRLlraG8LS0qHY4zH EC1utNpUDaWGGyAJPRSboISq/fDCJnTlwCCSy53AY2ntIZwlz4xK1Z716fdxg+uagvh2 7JjNdC4TZwj2TsmjvLxzMsa1qwtVEEAV8uxesUmRtQbeRY8GHjFM0owf0CDxGyjBRK3C tK+TLnu2Xz6xnA4syA74t+zPhmNYAPMWvdEzF7Uv6sRrFVyte02nmS8R4q80paScTYGF dCZQ== ARC-Authentication-Results: i=1; mx.google.com; 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 n9-v6si1518283pll.695.2018.03.05.12.43.04; Mon, 05 Mar 2018 12:43:19 -0800 (PST) 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; 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 S932099AbeCEUmO (ORCPT + 99 others); Mon, 5 Mar 2018 15:42:14 -0500 Received: from mga12.intel.com ([192.55.52.136]:24160 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751779AbeCEUmM (ORCPT ); Mon, 5 Mar 2018 15:42:12 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Mar 2018 12:42:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,428,1515484800"; d="scan'208";a="205690771" Received: from unknown (HELO localhost.localdomain) ([10.232.112.44]) by orsmga005.jf.intel.com with ESMTP; 05 Mar 2018 12:42:09 -0800 Date: Mon, 5 Mar 2018 13:42:12 -0700 From: Keith Busch To: Jason Gunthorpe Cc: Sagi Grimberg , Oliver , Jens Axboe , "linux-nvdimm@lists.01.org" , linux-rdma@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, Alex Williamson , =?iso-8859-1?B?Suly9G1l?= Glisse , Benjamin Herrenschmidt , Bjorn Helgaas , Max Gurtovoy , Christoph Hellwig Subject: Re: [PATCH v2 07/10] nvme-pci: Use PCI p2pmem subsystem to manage the CMB Message-ID: <20180305204212.GD30975@localhost.localdomain> References: <20180228234006.21093-1-logang@deltatee.com> <20180228234006.21093-8-logang@deltatee.com> <20180305160004.GA30975@localhost.localdomain> <36c78987-006a-a97f-1d18-b0a08cbea9d4@grimberg.me> <20180305201053.GK11337@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180305201053.GK11337@mellanox.com> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 05, 2018 at 01:10:53PM -0700, Jason Gunthorpe wrote: > So when reading the above mlx code, we see the first wmb() being used > to ensure that CPU stores to cachable memory are visible to the DMA > triggered by the doorbell ring. IIUC, we don't need a similar barrier for NVMe to ensure memory is visibile to DMA since the SQE memory is allocated DMA coherent when the SQ is not within a CMB. > The mmiowb() is used to ensure that DB writes are not combined and not > issued in any order other than implied by the lock that encloses the > whole thing. This is needed because uar_map is WC memory. > > We don't have ordering with respect to two writel's here, so if ARM > performance was a concern the writel could be switched to > writel_relaxed(). > > Presumably nvme has similar requirments, although I guess the DB > register is mapped UC not WC? Yep, the NVMe DB register is required by the spec to be mapped UC.