Received: by 10.223.185.116 with SMTP id b49csp7980274wrg; Thu, 1 Mar 2018 14:46:52 -0800 (PST) X-Google-Smtp-Source: AG47ELt+h4Y4tQtilTRzzFa9GNtz6X/gmAi26K6GInabCitO4nFTnol4S4uX8oBUJPds8cwWu6tK X-Received: by 10.98.200.131 with SMTP id i3mr3589891pfk.40.1519944412474; Thu, 01 Mar 2018 14:46:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519944412; cv=none; d=google.com; s=arc-20160816; b=Paj3PoSj8dR9S2bArPvoKNpOJ+a05RVZVpk5jKwXkdiiIqQUULyXa/QuYw87TpFRq1 ZvXEs5QLDw8vPFo3B9/9YDI8NkRuOuZ1EGU/Ei7B6g7fQsTrKEFocUGQn9Pjnuf/v8QJ ULb9uFzgYLJGOvRdaHAcO7XXF7iln0/zHaEjD0wa23TmnM83rC0kewmH1YWp7DJ5hFDV 6VRCR9eFk56gG/3z297afQXBVoT5VACdzCawNjZ9w/TZkRL4zJU9DviLKj7YI9QRWcSM OplVBxGejmKP96OhKgwDIRQW49KYvzQ+k2tcACDDRkZD2+b72oywLKQyhmT+VVRbRFBG ewUw== 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=xhcEQnCDwHdww5LcnzMMmW/zaUMMSa9XEVo324lKQsw=; b=FwdLkSoSPVEZHT1Qd7vXHI9gzBoINS9gb+0MJNn/xWjV+AmP99ytNyp87lkgYm1cnZ nBZ+UUi27eluhbc7lg2V/ebQ5nncD7je/cmNRl6K6+ULrfsshZYB2M6m7iJFc0TxGIgO 81DONvtFNIAI3bQHDgJzevkaPDs/zJ05p+DodG1InntJjDvUqnmVzs8vrhZBPinmypQu d1ck8kBonq/eYDDnkNezyWVln39zj47EmvCTVjiCmGWZCXA5BnPjdNWqWSLXCvaMuuQP hra4SdWQg/J5jKioDBdYAQNgttGheyZQ2GDan4W/RCj0zw3D6wkCC8/i7zxcZsAHvkQa REpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=naKn2RBm; 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 f15si2954243pgu.742.2018.03.01.14.46.37; Thu, 01 Mar 2018 14:46:52 -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; dkim=pass header.i=@ziepe.ca header.s=google header.b=naKn2RBm; 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 S1162723AbeCAWpv (ORCPT + 99 others); Thu, 1 Mar 2018 17:45:51 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:39567 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162589AbeCAWps (ORCPT ); Thu, 1 Mar 2018 17:45:48 -0500 Received: by mail-wr0-f196.google.com with SMTP id w77so8236444wrc.6 for ; Thu, 01 Mar 2018 14:45:47 -0800 (PST) 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=xhcEQnCDwHdww5LcnzMMmW/zaUMMSa9XEVo324lKQsw=; b=naKn2RBm0DMWj1UZBtF/gf6A1MdvxvG5vcv0GxrhgCCjlT8dWlfvuaJMtUet0lO7CP MyPdsb9oRksqQ7s2IFOS2hleyq8qvf1z3tsRolDoW2CUyVh5tOj+pm8P5E461N/Rb+0T l56p7Kbe/ioV7fcxTLpP5pvRE7+kjli6BW9kfUBbSOLVNdkZ3K04gTNm/5cxMpScnT1J Kt57geZDOZYZu33cnX0v1pyXJZOs7G7nvACVDQjVjbO24S9GPR/6jpyzfBGmEdzXHEVM SuuGEEfC5BdmsM1onvL51IeksnDUJ3n9LTBKDUCqHh3gnXxosQdaRBJlMwm1XIlCHA/G xwiw== 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=xhcEQnCDwHdww5LcnzMMmW/zaUMMSa9XEVo324lKQsw=; b=X6VMoqIokf/7bJVRar57QBuqkZqqpdU1Ve9y07s+DBXhLQM71WL6x53fUnle+OZtT5 i+iDSy5V0URKswY3Bm2Ed80o2v1xvpNseXeOR0oPiqv8u/t70UhhdjhZg2TMg39Dv99Y Clb4sr/sv4bX5zwokvEoER9bLlbngCZEmJDgnk+xslLwyp63PKlBmRvkG+3muP9R49KB yC+IcxvOEBsIE/gNc/JJbz46ocybU+ThH8ItucmNnb2QH7QKXMIiRcyApEbCad9j4qBr jNUEzuB3KGjdAhnYqAsqgBA9BV/mOmltUXJBG6Eq5JVgITjZARuDXm+/6KWbOsPsaZ6E MTww== X-Gm-Message-State: APf1xPD+vcturv7VKVoOEVflK0i3ZOHEj2MA5NMHUe/4gFLn0SWgsaE+ cGAC38K3QZUsHONsL8lTyymK9w== X-Received: by 10.223.159.79 with SMTP id f15mr3317699wrg.115.1519944347224; Thu, 01 Mar 2018 14:45:47 -0800 (PST) Received: from ziepe.ca (S010614cc2056d97f.ed.shawcable.net. [70.74.179.152]) by smtp.gmail.com with ESMTPSA id u79sm6515324wma.10.2018.03.01.14.45.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Mar 2018 14:45:46 -0800 (PST) Received: from jgg by mlx.ziepe.ca with local (Exim 4.86_2) (envelope-from ) id 1erWxI-0000dp-Fq; Thu, 01 Mar 2018 15:45:40 -0700 Date: Thu, 1 Mar 2018 15:45:40 -0700 From: Jason Gunthorpe To: Logan 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?SsOpcsO0bWU=?= Glisse , Benjamin Herrenschmidt , Alex Williamson , Steve Wise Subject: Re: [PATCH v2 10/10] nvmet: Optionally use PCI P2P memory Message-ID: <20180301224540.GL19007@ziepe.ca> 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> 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 Thu, Mar 01, 2018 at 12:27:03PM -0700, Logan Gunthorpe wrote: > > > On 01/03/18 11:42 AM, Jason Gunthorpe wrote: > >On Thu, Mar 01, 2018 at 08:35:55PM +0200, Sagi Grimberg wrote: > >This is also why I don't entirely understand why this series has a > >generic allocator for p2p mem, it makes little sense to me. > > >Why wouldn't the nmve driver just claim the entire CMB of its local > >device for its own use? Why involve p2p core code in this? > > We'd prefer to have a generic way to get p2pmem instead of restricting > ourselves to only using CMBs. We did work in the past where the P2P memory > was part of an IB adapter and not the NVMe card. So this won't work if it's > an NVMe only interface. It just seems like it it making it too complicated. In 99% of cases locality is important and you don't want to accidently use a buffer in a 3rd device that has no relation to the two doing the transfer just because it happened to be returned by the generic allocator. I can appreciate you might have some special use case for that, but it absolutely should require special configuration and not just magically happen. 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. 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? Jason