From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: MIME-Version: 1.0 In-Reply-To: <20171009185840.GB15336@obsidianresearch.com> References: <150732931273.22363.8436792888326501071.stgit@dwillia2-desk3.amr.corp.intel.com> <150732935473.22363.1853399637339625023.stgit@dwillia2-desk3.amr.corp.intel.com> <20171009185840.GB15336@obsidianresearch.com> From: Dan Williams Date: Mon, 9 Oct 2017 12:05:30 -0700 Message-ID: Subject: Re: [PATCH v7 07/12] dma-mapping: introduce dma_has_iommu() Content-Type: text/plain; charset="UTF-8" Sender: owner-linux-mm@kvack.org To: Jason Gunthorpe Cc: "linux-nvdimm@lists.01.org" , Jan Kara , Ashok Raj , "Darrick J. Wong" , linux-rdma@vger.kernel.org, Greg Kroah-Hartman , Joerg Roedel , Dave Chinner , linux-xfs@vger.kernel.org, Linux MM , Jeff Moyer , Linux API , linux-fsdevel , Ross Zwisler , David Woodhouse , Robin Murphy , Christoph Hellwig , Marek Szyprowski List-ID: On Mon, Oct 9, 2017 at 11:58 AM, Jason Gunthorpe wrote: > On Fri, Oct 06, 2017 at 03:35:54PM -0700, Dan Williams wrote: >> otherwise be quiesced. The need for this knowledge is driven by a need >> to make RDMA transfers to DAX mappings safe. If the DAX file's block map >> changes we need to be to reliably stop accesses to blocks that have been >> freed or re-assigned to a new file. > > If RDMA is driving this need, why not invalidate backing RDMA MRs > instead of requiring a IOMMU to do it? RDMA MR are finer grained and > do not suffer from the re-use problem David W. brought up with IOVAs.. Sounds promising. All I want in the end is to be sure that the kernel is enabled to stop any in-flight RDMA at will without asking userspace. Does this require per-RDMA driver opt-in or is there a common call that can be made? Outside of that the re-use problem is already solved by just unmapping (iommu_unmap()) the IOVA, but keeping it allocated until the eventual dma_unmap_sg() at memory un-registration time frees it. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-f48.google.com ([209.85.218.48]:56280 "EHLO mail-oi0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754380AbdJITFc (ORCPT ); Mon, 9 Oct 2017 15:05:32 -0400 Received: by mail-oi0-f48.google.com with SMTP id g125so23940595oib.12 for ; Mon, 09 Oct 2017 12:05:31 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20171009185840.GB15336@obsidianresearch.com> References: <150732931273.22363.8436792888326501071.stgit@dwillia2-desk3.amr.corp.intel.com> <150732935473.22363.1853399637339625023.stgit@dwillia2-desk3.amr.corp.intel.com> <20171009185840.GB15336@obsidianresearch.com> From: Dan Williams Date: Mon, 9 Oct 2017 12:05:30 -0700 Message-ID: Subject: Re: [PATCH v7 07/12] dma-mapping: introduce dma_has_iommu() Content-Type: text/plain; charset="UTF-8" Sender: linux-xfs-owner@vger.kernel.org List-ID: List-Id: xfs To: Jason Gunthorpe Cc: "linux-nvdimm@lists.01.org" , Jan Kara , Ashok Raj , "Darrick J. Wong" , linux-rdma@vger.kernel.org, Greg Kroah-Hartman , Joerg Roedel , Dave Chinner , linux-xfs@vger.kernel.org, Linux MM , Jeff Moyer , Linux API , linux-fsdevel , Ross Zwisler , David Woodhouse , Robin Murphy , Christoph Hellwig , Marek Szyprowski On Mon, Oct 9, 2017 at 11:58 AM, Jason Gunthorpe wrote: > On Fri, Oct 06, 2017 at 03:35:54PM -0700, Dan Williams wrote: >> otherwise be quiesced. The need for this knowledge is driven by a need >> to make RDMA transfers to DAX mappings safe. If the DAX file's block map >> changes we need to be to reliably stop accesses to blocks that have been >> freed or re-assigned to a new file. > > If RDMA is driving this need, why not invalidate backing RDMA MRs > instead of requiring a IOMMU to do it? RDMA MR are finer grained and > do not suffer from the re-use problem David W. brought up with IOVAs.. Sounds promising. All I want in the end is to be sure that the kernel is enabled to stop any in-flight RDMA at will without asking userspace. Does this require per-RDMA driver opt-in or is there a common call that can be made? Outside of that the re-use problem is already solved by just unmapping (iommu_unmap()) the IOVA, but keeping it allocated until the eventual dma_unmap_sg() at memory un-registration time frees it.