Received: by 10.223.185.116 with SMTP id b49csp7987883wrg; Thu, 1 Mar 2018 14:57:59 -0800 (PST) X-Google-Smtp-Source: AG47ELsP5uY+zmSdLjuoPsnv31eMRfgl2wrNQSn93JaHb0mCEC+/js7kl3H2GsnEQUOukIobW9R4 X-Received: by 10.99.164.81 with SMTP id c17mr2893054pgp.114.1519945079426; Thu, 01 Mar 2018 14:57:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519945079; cv=none; d=google.com; s=arc-20160816; b=IVRJbYJMC5GdUAbwolCeDGWjl8/EsNLWQZwxWrxvx7RQH+wyJa8q8r5Riu4PqKo5xL qtueLRMAjitqyQdMgKTEl82xn+XKrbQ0oXTlr2A+fyV6Mmm0uDFXeTiMWAj8U3qb8Rwd 7Gg2WkgDyrl5v/B4ahKkpIMuP1Mm81uH6YnWSmTMNLeVaFPpr75YaQdg26pTLCJxReqw jj40hhTLW53WXDKDitu8xfOvSz2Ml8fmRUuKl1mvzpQgGrxg3iTB3Cg6gvVso1isloFt GE+vZHs799yVeoyeiO4vIBTvL33Uqck9fIN5umxWwxGgiwyBsuCsGrMQUYH55aeezb6g yRsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:arc-authentication-results; bh=LcuZmg9O+Q1mA99MoMe1ElFpd4HuLX6kymmovqwB5jc=; b=rJVnbrttMyTIBGcrebJyGxehVP0e8yCXcCrlvo2xDjzC0wBDy+8BYgo/RJA+fmv/kQ Ofxerco0EAu3ORYVJ4ITcYd3GSG30jYwdN2PnTQvyYldIT8zDyNDPjwv+QlYKdCgP74+ o/YUoxODdstcwJVOR/GpLRbppvbIgDJ7GZCpghEmKSITkRC6o4xTfXYIKJlBKVVsmSS/ xXNTrt45L71aijrz2Y/LRd0Zw64uq5M9ki6M/kTJCm39ozx9YkXxdqeQ7y3kL9sOLx87 GIagUA+QjkRJn31kQ8+J37T39I7a0d/hUzOVch0bPCMUgsxGKRixHYUI+J2wtgj+xjj5 WrUg== 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 l137si3053079pga.525.2018.03.01.14.57.44; Thu, 01 Mar 2018 14:57:59 -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 S1162773AbeCAW4z (ORCPT + 99 others); Thu, 1 Mar 2018 17:56:55 -0500 Received: from ale.deltatee.com ([207.54.116.67]:39342 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162589AbeCAW4x (ORCPT ); Thu, 1 Mar 2018 17:56:53 -0500 Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtp (Exim 4.89) (envelope-from ) id 1erX7w-0002Yw-9f; Thu, 01 Mar 2018 15:56:41 -0700 To: Jason Gunthorpe Cc: Sagi Grimberg , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-nvme@lists.infradead.org, linux-rdma@vger.kernel.org, linux-nvdimm@lists.01.org, linux-block@vger.kernel.org, Stephen Bates , Christoph Hellwig , Jens Axboe , Keith Busch , Bjorn Helgaas , Max Gurtovoy , Dan Williams , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Benjamin Herrenschmidt , Alex Williamson , Steve Wise References: <20180228234006.21093-1-logang@deltatee.com> <20180228234006.21093-11-logang@deltatee.com> <749e3752-4349-0bdf-5243-3d510c2b26db@grimberg.me> <40d69074-31a8-d06a-ade9-90de7712c553@deltatee.com> <5649098f-b775-815b-8b9a-f34628873ff4@grimberg.me> <20180301184249.GI19007@ziepe.ca> <20180301224540.GL19007@ziepe.ca> From: Logan Gunthorpe Message-ID: Date: Thu, 1 Mar 2018 15:56:38 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180301224540.GL19007@ziepe.ca> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.162 X-SA-Exim-Rcpt-To: swise@opengridcomputing.com, alex.williamson@redhat.com, benh@kernel.crashing.org, jglisse@redhat.com, dan.j.williams@intel.com, maxg@mellanox.com, bhelgaas@google.com, keith.busch@intel.com, axboe@kernel.dk, hch@lst.de, sbates@raithlin.com, linux-block@vger.kernel.org, linux-nvdimm@lists.01.org, linux-rdma@vger.kernel.org, linux-nvme@lists.infradead.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, sagi@grimberg.me, jgg@ziepe.ca X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-8.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE,T_RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.1 Subject: Re: [PATCH v2 10/10] nvmet: Optionally use PCI P2P memory X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/03/18 03:45 PM, Jason Gunthorpe wrote: > I can appreciate you might have some special use case for that, but it > absolutely should require special configuration and not just magically > happen. Well if driver doesn't want someone doing p2p transfers with the memory it shouldn't publish it to be used for exactly that purpose. > You bring up IB adaptor memory - if we put that into the allocator > then what is to stop the NMVe driver just using it instead of the CMB > buffer? That would be totally wrong in almost all cases. If you mean for SQEs in the NVMe driver, look at the code, it specifically allocates it from it's own device. If you mean the nvmet-rdma then it's using that memory exactly as it was meant to. Again, if the IB driver doesn't want someone to use that memory for P2P transfers it shouldn't publish it as such. > Seems like a very subtle and hard to debug performance trap to leave > for the users, and pretty much the only reason to use P2P is > performance... So why have such a dangerous interface? It's not at all dangerous, the code specifically only uses P2P memory that's local enough. And the majority of the code is there to make sure it will all work in all cases. Honestly, though, I'd love to go back to the case where the user selects which p2pmem device to use, but that was very unpopular last year. It would simplify a bunch of things though. Also, no, the reason to use P2P is not performance. Only if you have very specific hardware can you get a performance bump and it isn't all that significant. The reason to use P2P is so you can design performant systems with small CPUs, less or slower DRAM, and low lane counts to the CPU, etc. Logan