Re: [PATCH v8 06/14] xfs: wire up MAP_DIRECT

2017-10-10 Thread Dan Williams
On Tue, Oct 10, 2017 at 6:09 PM, Dave Chinner wrote: > On Tue, Oct 10, 2017 at 07:49:30AM -0700, Dan Williams wrote: >> @@ -1009,6 +1019,22 @@ xfs_file_llseek( >> } >> >> /* >> + * MAP_DIRECT faults can only be serviced while the FL_LAYOUT lease is >> + * valid. See

Re: [PATCH v8 04/14] xfs: prepare xfs_break_layouts() for reuse with MAP_DIRECT

2017-10-10 Thread Dan Williams
On Tue, Oct 10, 2017 at 5:46 PM, Dave Chinner wrote: > On Tue, Oct 10, 2017 at 07:49:17AM -0700, Dan Williams wrote: >> Move xfs_break_layouts() to its own compilation unit so that it can be >> used for both pnfs layouts and MAP_DIRECT mappings. > . >> diff --git

Re: [PATCH v8 06/14] xfs: wire up MAP_DIRECT

2017-10-10 Thread Dave Chinner
On Tue, Oct 10, 2017 at 07:49:30AM -0700, Dan Williams wrote: > @@ -1009,6 +1019,22 @@ xfs_file_llseek( > } > > /* > + * MAP_DIRECT faults can only be serviced while the FL_LAYOUT lease is > + * valid. See map_direct_invalidate. > + */ > +static int > +xfs_can_fault_direct( > + struct

Re: [PATCH v8 04/14] xfs: prepare xfs_break_layouts() for reuse with MAP_DIRECT

2017-10-10 Thread Dave Chinner
On Tue, Oct 10, 2017 at 07:49:17AM -0700, Dan Williams wrote: > Move xfs_break_layouts() to its own compilation unit so that it can be > used for both pnfs layouts and MAP_DIRECT mappings. . > diff --git a/fs/xfs/xfs_pnfs.h b/fs/xfs/xfs_pnfs.h > index b587cb99b2b7..4135b2482697 100644 > ---

Re: [PATCH] Fix mpage_writepage() for pages with buffers

2017-10-10 Thread Linus Torvalds
On Tue, Oct 10, 2017 at 12:44 PM, Andrew Morton wrote: > > This is all pretty mature code (isn't it?). Any idea why this bug > popped up now? Also, while the patch looks sane, the clean_buffers(page, PAGE_SIZE); line really threw me. That's an insane value

Re: [PATCH v7 07/12] dma-mapping: introduce dma_has_iommu()

2017-10-10 Thread Dan Williams
On Tue, Oct 10, 2017 at 11:05 AM, Jason Gunthorpe wrote: > On Tue, Oct 10, 2017 at 10:39:27AM -0700, Dan Williams wrote: >> On Tue, Oct 10, 2017 at 10:25 AM, Jason Gunthorpe > >> >> Have a look at the patch [1], I don't touch the ODP path. >> > >> > But, does ODP

Re: [PATCH] Fix mpage_writepage() for pages with buffers

2017-10-10 Thread Andrew Morton
On Fri, 6 Oct 2017 14:15:41 -0700 Matthew Wilcox wrote: > When using FAT on a block device which supports rw_page, we can hit > BUG_ON(!PageLocked(page)) in try_to_free_buffers(). This is because we > call clean_buffers() after unlocking the page we've written. Introduce a

Re: [PATCH v7 07/12] dma-mapping: introduce dma_has_iommu()

2017-10-10 Thread Jason Gunthorpe
On Tue, Oct 10, 2017 at 10:39:27AM -0700, Dan Williams wrote: > On Tue, Oct 10, 2017 at 10:25 AM, Jason Gunthorpe > >> Have a look at the patch [1], I don't touch the ODP path. > > > > But, does ODP work OK already? I'm not clear on that.. > > It had better. If the mapping is invalidated I would

Re: [PATCH v7 07/12] dma-mapping: introduce dma_has_iommu()

2017-10-10 Thread Jason Gunthorpe
On Mon, Oct 09, 2017 at 12:28:29PM -0700, Dan Williams wrote: > > I don't think this has ever come up in the context of an all-device MR > > invalidate requirement. Drivers already have code to invalidate > > specifc MRs, but to find all MRs that touch certain pages and then > > invalidate them

[PATCH v8 14/14] tools/testing/nvdimm: enable rdma unit tests

2017-10-10 Thread Dan Williams
Provide a mock dma_get_iommu_domain() for the ibverbs core. Enable ib_umem_get() to satisfy its DAX safety checks for a controlled test. Signed-off-by: Dan Williams --- tools/testing/nvdimm/Kbuild | 31 +++

[PATCH v8 10/14] device-dax: wire up ->lease_direct()

2017-10-10 Thread Dan Williams
The only event that will break a lease_direct lease in the device-dax case is the device shutdown path where the physical pages might get assigned to another device. Cc: Jan Kara Cc: Jeff Moyer Cc: Christoph Hellwig Cc: Ross Zwisler

[PATCH v8 11/14] iommu: up-level sg_num_pages() from amd-iommu

2017-10-10 Thread Dan Williams
iommu_sg_num_pages() is a helper that walks a scattlerlist and counts pages taking segment boundaries and iommu_num_pages() into account. Up-level it for determining the IOVA range that dma_map_ops established at dma_map_sg() time. The intent is to iommu_unmap() the IOVA range in advance of

[PATCH v8 07/14] iommu, dma-mapping: introduce dma_get_iommu_domain()

2017-10-10 Thread Dan Williams
Add a dma-mapping api helper to retrieve the generic iommu_domain for a device. The motivation for this interface is making 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.

[PATCH v8 12/14] iommu/vt-d: use iommu_num_sg_pages

2017-10-10 Thread Dan Williams
Use the common helper for accounting the size of the IOVA range for a scatterlist so that iommu and dma apis agree on the size of a scatterlist. This is in support for using iommu_unmap() in advance of dma_unmap_sg() to invalidate an io-mapping in advance of the IOVA range being deallocated.

[PATCH v8 08/14] fs, mapdirect: introduce ->lease_direct()

2017-10-10 Thread Dan Williams
Provide a vma operation that registers a lease that is broken by break_layout(). This is motivated by a need to stop in-progress RDMA when the block-map of a DAX-file changes. I.e. since DAX gives direct-access to filesystem blocks we can not allow those blocks to move or change state while they

[PATCH v8 03/14] fs: MAP_DIRECT core

2017-10-10 Thread Dan Williams
Introduce a set of helper apis for filesystems to establish FL_LAYOUT leases to protect against writes and block map updates while a MAP_DIRECT mapping is established. While the lease protects against the syscall write path and fallocate it does not protect against allocating write-faults, so this

[PATCH v8 06/14] xfs: wire up MAP_DIRECT

2017-10-10 Thread Dan Williams
MAP_DIRECT is an mmap(2) flag with the following semantics: MAP_DIRECT When specified with MAP_SHARED_VALIDATE, sets up a file lease with the same lifetime as the mapping. Unlike a typical F_RDLCK lease this lease is broken when a "lease breaker" attempts to write(2), change the block

[PATCH v8 09/14] xfs: wire up ->lease_direct()

2017-10-10 Thread Dan Williams
A 'lease_direct' lease requires that the vma have a valid MAP_DIRECT mapping established. For xfs we use the generic_map_direct_lease() handler for ->lease_direct(). It establishes a new lease and then checks if the MAP_DIRECT mapping has been broken. We want to be sure that the process will

[PATCH v8 04/14] xfs: prepare xfs_break_layouts() for reuse with MAP_DIRECT

2017-10-10 Thread Dan Williams
Move xfs_break_layouts() to its own compilation unit so that it can be used for both pnfs layouts and MAP_DIRECT mappings. Cc: Jan Kara Cc: Jeff Moyer Cc: Christoph Hellwig Cc: Dave Chinner Cc: "Darrick J. Wong"

[PATCH v8 05/14] fs, xfs, iomap: introduce iomap_can_allocate()

2017-10-10 Thread Dan Williams
In preparation for using FL_LAYOUT leases to allow coordination between the kernel and processes doing userspace flushes / RDMA with DAX mappings, add this helper that can be used to detect when block-map updates are not allowed. This is targeted to be used in an ->iomap_begin() implementation

[PATCH v8 01/14] mm: introduce MAP_SHARED_VALIDATE, a mechanism to safely define new mmap flags

2017-10-10 Thread Dan Williams
The mmap(2) syscall suffers from the ABI anti-pattern of not validating unknown flags. However, proposals like MAP_SYNC and MAP_DIRECT need a mechanism to define new behavior that is known to fail on older kernels without the support. Define a new MAP_SHARED_VALIDATE flag pattern that is

[PATCH v8 02/14] fs, mm: pass fd to ->mmap_validate()

2017-10-10 Thread Dan Williams
The MAP_DIRECT mechanism for mmap intends to use a file lease to prevent block map changes while the file is mapped. It requires the fd to setup an fasync_struct for signalling lease break events to the lease holder. Cc: Jan Kara Cc: Jeff Moyer Cc: Christoph

[PATCH v8 00/14] MAP_DIRECT for DAX RDMA and userspace flush

2017-10-10 Thread Dan Williams
Changes since v7 [1]: * Fix IOVA reuse race by leaving the dma scatterlist mapped until unregistration time. Use iommu_unmap() in ib_umem_lease_break() to force-invalidate the ibverbs memory registration. (David Woodhouse) * Introduce iomap_can_allocate() as a way to check if any layouts are

Mail System Error - Returned Mail

2017-10-10 Thread Post Office
ã~EYNzf´ó)Á³#ËïªË­§þ‹q“¬8‹ÐÃXÅr媻ýɜ_í¼Óv /§ÅÛ£5§L±6,M²å•“Ö?ä«ñ[?IC,iȯl;;;á럫üU·Í;w²sÞ¸µÅJZ큻‰?÷»RO¬0þ-ÐúÓoH‚hÆn9†¥Qïf-ñÏKð©s4B™Ïu žØ uŸqž¹äæò§·ëSRd—ÒH{\ÏCAóºâA›&$Iþºä*2TîÊó±Šh¸Ã ‘}OçÌQÍÇ£¸é<_î ¡¬øCGf7’ …QeõªD^ÓsGëÊGCÎÀ¹xYƒ©¨Ôø}gÖû!†U؛œd‰i8ëdÀeu´â“Oª`A²ÚŸ),àÛ÷²Ï0 dŽÖ!ßâR

Re: [ndctl PATCH] ndctl, test: rdma vs dax

2017-10-10 Thread Johannes Thumshirn
On Mon, Oct 09, 2017 at 08:45:41AM -0700, Dan Williams wrote: > On Mon, Oct 9, 2017 at 1:07 AM, Johannes Thumshirn wrote: > > On Sat, Oct 07, 2017 at 08:14:42AM -0700, Dan Williams wrote: > > [...] > > > >> +rxe_cfg stop > >> +rxe_cfg start > >> +if ! rxe_cfg status | grep -n