From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78D6AC48BD6 for ; Wed, 26 Jun 2019 21:00:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4F31F2086D for ; Wed, 26 Jun 2019 21:00:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="Bzws5exL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726431AbfFZVAV (ORCPT ); Wed, 26 Jun 2019 17:00:21 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:37909 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726354AbfFZVAU (ORCPT ); Wed, 26 Jun 2019 17:00:20 -0400 Received: by mail-pl1-f196.google.com with SMTP id g4so195plb.5 for ; Wed, 26 Jun 2019 14:00:20 -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=n76JK0suQeeFW6xhcmoHNw4tHnQpupZZOhWEzOjxM6k=; b=Bzws5exLVLEQgXXhLhLFWqBVYZgCRHFpKtPyJBjrSzDy5QeDAHSVxsk8YbisLRWP8K gyvdK9QMRZC/Q9Lv8BEC1bfZcneBYta/G2rBRALUo6HTzmUqzFrqVSlVj6lxlLP8iVD/ ItXAUkEnikSxp7rVIR66tj23/0yyoFt6OR9A5zPnz0Zdh0XhP3IFRUqiX6ed1780IoNc 68xBPq3zg9j1M+eT5Cgt5VQeye7h1DSohOgMQOI97tGEfTRmJRNbHVsgZr/i/ymDA0oA rvDhJ0nAfbrM6fDUXFbeFu7iU0ZewvMV7C6xqGI1Z1GztnlgZD3hT6pAeKUwZKjoJnKO +dBA== 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=n76JK0suQeeFW6xhcmoHNw4tHnQpupZZOhWEzOjxM6k=; b=F9Qio9TzQrJgkzwbMTvTxZlHDzPTb/3FOY4S6MJUMf+cG0ogy8BRHBwIFSuT/NbHH8 cp0iord7yoS3R15jqzwGx/UsfHZ67AW9wX/VAEDgIpT70W7ftzMdhFN7yZyLJcEPHNVM yB19839fAiZZziVaGdwYCtUoKQUrNshNxje0zLqKK8SWJMFypwzWVyyyZLdbeQSXsdo9 pQty6OhI6+AUa7C4BeVMMUNcapVFc2Kix1BZKSUT24KoGVVl6/hS4jIEaPQgWFBrJNjB upcXvu0UIspTcXzAL5r/hcKQLeFvLalpxNy4zxoP2n+XdHo8jXLHHLQK9OFa5bBYx3Pj nBTQ== X-Gm-Message-State: APjAAAXhH86fccWRBtJXfct8BzdmmS7hpZeDMcpmJo7H9sWUdHRiQotR Q/drjaq+AXZZdsWZJEO31tnHGg== X-Google-Smtp-Source: APXvYqxn58rW6cya64e/DP42Cl4dWDsxuE9ORp8ZfuhKICUjVgykMrFxCwFRYmlyz7x1VeOTA+0fBw== X-Received: by 2002:a17:902:20b:: with SMTP id 11mr144473plc.78.1561582819849; Wed, 26 Jun 2019 14:00:19 -0700 (PDT) Received: from ziepe.ca ([148.87.23.38]) by smtp.gmail.com with ESMTPSA id p27sm134242pfq.136.2019.06.26.14.00.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 26 Jun 2019 14:00:19 -0700 (PDT) Received: from jgg by jggl.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hgF1e-0001mN-Hl; Wed, 26 Jun 2019 18:00:18 -0300 Date: Wed, 26 Jun 2019 18:00:18 -0300 From: Jason Gunthorpe To: Logan Gunthorpe Cc: Christoph Hellwig , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, linux-pci@vger.kernel.org, linux-rdma@vger.kernel.org, Jens Axboe , Bjorn Helgaas , Dan Williams , Sagi Grimberg , Keith Busch , Stephen Bates Subject: Re: [RFC PATCH 00/28] Removing struct page from P2PDMA Message-ID: <20190626210018.GB6392@ziepe.ca> References: <20190624072752.GA3954@lst.de> <558a27ba-e7c9-9d94-cad0-377b8ee374a6@deltatee.com> <20190625072008.GB30350@lst.de> <20190625170115.GA9746@lst.de> <41235a05-8ed1-e69a-e7cd-48cae7d8a676@deltatee.com> <20190626065708.GB24531@lst.de> <20190626202107.GA5850@ziepe.ca> <8a0a08c3-a537-bff6-0852-a5f337a70688@deltatee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8a0a08c3-a537-bff6-0852-a5f337a70688@deltatee.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 26, 2019 at 02:45:38PM -0600, Logan Gunthorpe wrote: > > > On 2019-06-26 2:21 p.m., Jason Gunthorpe wrote: > > On Wed, Jun 26, 2019 at 12:31:08PM -0600, Logan Gunthorpe wrote: > >>> we have a hole behind len where we could store flag. Preferably > >>> optionally based on a P2P or other magic memory types config > >>> option so that 32-bit systems with 32-bit phys_addr_t actually > >>> benefit from the smaller and better packing structure. > >> > >> That seems sensible. The one thing that's unclear though is how to get > >> the PCI Bus address when appropriate. Can we pass that in instead of the > >> phys_addr with an appropriate flag? Or will we need to pass the actual > >> physical address and then, at the map step, the driver has to some how > >> lookup the PCI device to figure out the bus offset? > > > > I agree with CH, if we go down this path it is a layering violation > > for the thing injecting bio's into the block stack to know what struct > > device they egress&dma map on just to be able to do the dma_map up > > front. > > Not sure I agree with this statement. The p2pdma code already *must* > know and access the pci_dev of the dma device ahead of when it submits > the IO to know if it's valid to allocate and use P2P memory at all. I don't think we should make drives do that. What if it got CMB memory on some other device? > > For instance we could use a small hash table of the upper phys addr > > bits, or an interval tree, to do the lookup. > > Yes, if we're going to take a hard stance on this. But using an interval > tree (or similar) is a lot more work for the CPU to figure out these > mappings that may not be strictly necessary if we could just pass better > information down from the submitting driver to the mapping driver. Right, this is coming down to an optimization argument. I think there are very few cases (Basically yours) where the caller will know this info, so we need to support the other cases anyhow. I think with some simple caching this will become negligible for cases you care about Jason