nvdimm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Keith Busch <keith.busch@intel.com>
To: Logan Gunthorpe <logang@deltatee.com>
Cc: "Jens Axboe" <axboe@kernel.dk>,
	"Alex Williamson" <alex.williamson@redhat.com>,
	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,
	"Jérôme Glisse" <jglisse@redhat.com>,
	"Jason Gunthorpe" <jgg@mellanox.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Benjamin Herrenschmidt" <benh@kernel.crashing.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Max Gurtovoy" <maxg@mellanox.com>,
	"Christoph Hellwig" <hch@lst.de>
Subject: Re: [PATCH v7 10/13] nvme-pci: Add support for P2P memory in requests
Date: Tue, 25 Sep 2018 11:48:35 -0600	[thread overview]
Message-ID: <20180925174835.GA12185@localhost.localdomain> (raw)
In-Reply-To: <3549a9bb-3604-1739-c008-4e1a95441333@deltatee.com>

On Tue, Sep 25, 2018 at 11:41:44AM -0600, Logan Gunthorpe wrote:
> Hey,
> 
> On 2018-09-25 11:11 a.m., Keith Busch wrote:
> > Sorry if this was already discussed. Is there a reason the following
> > pattern is not pushed to the generic dma_map_sg_attrs?
> > 
> > 	if (is_pci_p2pdma_page(sg_page(sg)))
> > 		pci_p2pdma_map_sg(dev, sg, nents, dma_dir);
> > 
> > Beyond that, series looks good.
> 
> Yes, this has been discussed. It comes down to a few reasons:
> 
> 1) Intrusiveness on other systems: ie. not needing to pay the cost for
> every single dma_map_sg call
> 
> 2) Consistency: we can add the check to dma_map_sg, but adding similar
> functionality to dma_map_page, etc is difficult seeing it's hard for the
> unmap operation to detect if a dma_addr_t was P2P memory to begin with.
> 
> 3) Safety for developers trying to use P2P memory: Right now developers
> must be careful with P2P pages and ensure they aren't mapped using other
> means (ie dma_map_page). Having them check the drivers that are handling
> the pages to ensure the appropriate map function is always used is and
> that P2P pages aren't being mixed with regular pages is better than
> developers relying on magic in dma_map_sg() and getting things wrong.
> 
> That being said, I think in the future everyone would like to move in
> that direction but it means we will have to solve some difficult
> problems with the existing infrastructure.

Gotchya, thanks for jogging my memory.
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

  reply	other threads:[~2018-09-25 17:47 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-25 16:22 [PATCH v7 00/13] Copy Offload in NVMe Fabrics with P2P PCI Memory Logan Gunthorpe
2018-09-25 16:22 ` [PATCH v7 01/13] PCI/P2PDMA: Support peer-to-peer memory Logan Gunthorpe
2018-09-25 17:25   ` Bart Van Assche
2018-09-25 18:09     ` Logan Gunthorpe
2018-09-25 16:22 ` [PATCH v7 02/13] PCI/P2PDMA: Add sysfs group to display p2pmem stats Logan Gunthorpe
2018-09-25 17:29   ` Bart Van Assche
2018-09-25 18:15     ` Logan Gunthorpe
2018-09-25 18:31       ` Bart Van Assche
2018-09-25 18:51         ` Logan Gunthorpe
2018-09-25 16:22 ` [PATCH v7 03/13] PCI/P2PDMA: Add PCI p2pmem DMA mappings to adjust the bus offset Logan Gunthorpe
2018-09-25 17:33   ` Bart Van Assche
2018-09-25 18:46     ` Logan Gunthorpe
2018-09-25 16:22 ` [PATCH v7 04/13] PCI/P2PDMA: Introduce configfs/sysfs enable attribute helpers Logan Gunthorpe
2018-09-25 16:22 ` [PATCH v7 05/13] docs-rst: Add a new directory for PCI documentation Logan Gunthorpe
2018-09-25 16:22 ` [PATCH v7 06/13] PCI/P2PDMA: Add P2P DMA driver writer's documentation Logan Gunthorpe
2018-09-25 16:22 ` [PATCH v7 07/13] block: Add PCI P2P flag for request queue and check support for requests Logan Gunthorpe
2018-09-25 16:22 ` [PATCH v7 08/13] IB/core: Ensure we map P2P memory correctly in rdma_rw_ctx_[init|destroy]() Logan Gunthorpe
2018-09-25 16:22 ` [PATCH v7 09/13] nvme-pci: Use PCI p2pmem subsystem to manage the CMB Logan Gunthorpe
2018-09-25 16:22 ` [PATCH v7 10/13] nvme-pci: Add support for P2P memory in requests Logan Gunthorpe
2018-09-25 17:11   ` Keith Busch
2018-09-25 17:41     ` Logan Gunthorpe
2018-09-25 17:48       ` Keith Busch [this message]
2018-09-25 16:22 ` [PATCH v7 11/13] nvme-pci: Add a quirk for a pseudo CMB Logan Gunthorpe
2018-09-25 16:22 ` [PATCH v7 12/13] nvmet: Introduce helper functions to allocate and free request SGLs Logan Gunthorpe
2018-09-25 16:22 ` [PATCH v7 13/13] nvmet: Optionally use PCI P2P memory Logan Gunthorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180925174835.GA12185@localhost.localdomain \
    --to=keith.busch@intel.com \
    --cc=alex.williamson@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=benh@kernel.crashing.org \
    --cc=bhelgaas@google.com \
    --cc=christian.koenig@amd.com \
    --cc=hch@lst.de \
    --cc=jgg@mellanox.com \
    --cc=jglisse@redhat.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=logang@deltatee.com \
    --cc=maxg@mellanox.com \
    --subject='Re: [PATCH v7 10/13] nvme-pci: Add support for P2P memory in requests' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).