Re: [Qemu-devel] [RFC 2/2] KVM: add virtio-pmem driver

2017-10-19 Thread Christoph Hellwig
On Wed, Oct 18, 2017 at 08:51:37AM -0700, Dan Williams wrote: > This use case is not "Persistent Memory". Persistent Memory is > something you can map and make persistent with CPU instructions. > Anything that requires a driver call is device driver managed "Shared > Memory". How is this any diffe

Re: [Qemu-devel] [RFC 2/2] KVM: add virtio-pmem driver

2017-10-19 Thread Stefan Hajnoczi
On Wed, Oct 18, 2017 at 08:51:37AM -0700, Dan Williams wrote: > On Wed, Oct 18, 2017 at 6:03 AM, Stefan Hajnoczi wrote: > > On Tue, Oct 17, 2017 at 04:30:41AM -0400, Pankaj Gupta wrote: > >> > >> > > Are you saying do it as existing i.e ACPI pmem like interface? > >> > > The reason we have created

[PATCH 08/17] dax: Inline dax_pmd_insert_mapping() into the callsite

2017-10-19 Thread Jan Kara
dax_pmd_insert_mapping() has only one callsite and we will need to further fine tune what it does for synchronous faults. Just inline it into the callsite so that we don't have to pass awkward bools around. Reviewed-by: Christoph Hellwig Reviewed-by: Ross Zwisler Signed-off-by: Jan Kara --- fs

[PATCH 12/17] mm: Define MAP_SYNC and VM_SYNC flags

2017-10-19 Thread Jan Kara
Define new MAP_SYNC flag and corresponding VMA VM_SYNC flag. As the MAP_SYNC flag is not part of LEGACY_MAP_MASK, currently it will be refused by all MAP_SHARED_VALIDATE map attempts and silently ignored for everything else. Reviewed-by: Ross Zwisler Reviewed-by: Christoph Hellwig Signed-off-by:

[PATCH 14/17] dax: Implement dax_finish_sync_fault()

2017-10-19 Thread Jan Kara
Implement a function that filesystems can call to finish handling of synchronous page faults. It takes care of syncing appropriare file range and insertion of page table entry. Reviewed-by: Ross Zwisler Reviewed-by: Christoph Hellwig Signed-off-by: Jan Kara --- fs/dax.c |

[PATCH 17/17] xfs: support for synchronous DAX faults

2017-10-19 Thread Jan Kara
From: Christoph Hellwig Return IOMAP_F_DIRTY from xfs_file_iomap_begin() when asked to prepare blocks for writing and the inode is pinned, and has dirty fields other than the timestamps. In __xfs_filemap_fault() we then detect this case and call dax_finish_sync_fault() to make sure all metadata

[PATCH 09/17] dax: Fix comment describing dax_iomap_fault()

2017-10-19 Thread Jan Kara
Add missing argument description. Reviewed-by: Christoph Hellwig Reviewed-by: Ross Zwisler Signed-off-by: Jan Kara --- fs/dax.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/dax.c b/fs/dax.c index 675fab8ec41f..5214ed9ba508 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -14

[PATCH 04/17] dax: Factor out getting of pfn out of iomap

2017-10-19 Thread Jan Kara
Factor out code to get pfn out of iomap that is shared between PTE and PMD fault path. Reviewed-by: Christoph Hellwig Reviewed-by: Ross Zwisler Signed-off-by: Jan Kara --- fs/dax.c | 83 +--- 1 file changed, 43 insertions(+), 40 delet

[PATCH 10/17] dax: Allow dax_iomap_fault() to return pfn

2017-10-19 Thread Jan Kara
For synchronous page fault dax_iomap_fault() will need to return PFN which will then need to be inserted into page tables after fsync() completes. Add necessary parameter to dax_iomap_fault(). Reviewed-by: Christoph Hellwig Reviewed-by: Ross Zwisler Signed-off-by: Jan Kara --- fs/dax.c

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

2017-10-19 Thread Jan Kara
From: Dan Williams The mmap(2) syscall suffers from the ABI anti-pattern of not validating unknown flags. However, proposals like MAP_SYNC 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 guar

[PATCH 11/17] dax: Allow tuning whether dax_insert_mapping_entry() dirties entry

2017-10-19 Thread Jan Kara
Currently we dirty radix tree entry whenever dax_insert_mapping_entry() gets called for a write fault. With synchronous page faults we would like to insert clean radix tree entry and dirty it only once we call fdatasync() and update page tables to save some unnecessary cache flushing. Add 'dirty' a

[PATCH 05/17] dax: Create local variable for VMA in dax_iomap_pte_fault()

2017-10-19 Thread Jan Kara
There are already two users and more are coming. Reviewed-by: Christoph Hellwig Reviewed-by: Ross Zwisler Signed-off-by: Jan Kara --- fs/dax.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index 116eef8d6c69..c09465884bbe 100644 --- a/fs/dax.c +++

[PATCH 02/17] mm: Remove VM_FAULT_HWPOISON_LARGE_MASK

2017-10-19 Thread Jan Kara
It is unused. Reviewed-by: Ross Zwisler Reviewed-by: Christoph Hellwig Signed-off-by: Jan Kara --- include/linux/mm.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 065d99deb847..ca72b67153d5 100644 --- a/include/linux/mm.h +++ b/include/linu

[PATCH 13/17] dax, iomap: Add support for synchronous faults

2017-10-19 Thread Jan Kara
Add a flag to iomap interface informing the caller that inode needs fdstasync(2) for returned extent to become persistent and use it in DAX fault code so that we don't map such extents into page tables immediately. Instead we propagate the information that fdatasync(2) is necessary from dax_iomap_f

[PATCH 0/17 v4] dax, ext4, xfs: Synchronous page faults

2017-10-19 Thread Jan Kara
Hello, here is the fourth version of my patches to implement synchronous page faults for DAX mappings to make flushing of DAX mappings possible from userspace so that they can be flushed on finer than page granularity and also avoid the overhead of a syscall. We use a new mmap flag MAP_SYNC to in

[PATCH 16/17] ext4: Support for synchronous DAX faults

2017-10-19 Thread Jan Kara
We return IOMAP_F_DIRTY flag from ext4_iomap_begin() when asked to prepare blocks for writing and the inode has some uncommitted metadata changes. In the fault handler ext4_dax_fault() we then detect this case (through VM_FAULT_NEEDDSYNC return value) and call helper dax_finish_sync_fault() to flus

[PATCH 15/17] ext4: Simplify error handling in ext4_dax_huge_fault()

2017-10-19 Thread Jan Kara
If transaction starting fails, just bail out of the function immediately instead of checking for that condition throughout the function. Reviewed-by: Ross Zwisler Signed-off-by: Jan Kara --- fs/ext4/file.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/fs/ext4

[PATCH] mmap.2: Add description of MAP_SHARED_VALIDATE and MAP_SYNC

2017-10-19 Thread Jan Kara
Signed-off-by: Jan Kara --- man2/mmap.2 | 30 ++ 1 file changed, 30 insertions(+) diff --git a/man2/mmap.2 b/man2/mmap.2 index 47c3148653be..598ff0c64f7f 100644 --- a/man2/mmap.2 +++ b/man2/mmap.2 @@ -125,6 +125,21 @@ are carried through to the underlying file. to th

[PATCH 06/17] dax: Create local variable for vmf->flags & FAULT_FLAG_WRITE test

2017-10-19 Thread Jan Kara
There are already two users and more are coming. Reviewed-by: Christoph Hellwig Reviewed-by: Ross Zwisler Signed-off-by: Jan Kara --- fs/dax.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index c09465884bbe..5ea71381dba0 100644 --- a/fs/dax.c +++

[PATCH 07/17] dax: Inline dax_insert_mapping() into the callsite

2017-10-19 Thread Jan Kara
dax_insert_mapping() has only one callsite and we will need to further fine tune what it does for synchronous faults. Just inline it into the callsite so that we don't have to pass awkward bools around. Reviewed-by: Christoph Hellwig Reviewed-by: Ross Zwisler Signed-off-by: Jan Kara --- fs/dax

Re: [PATCH 17/17] xfs: support for synchronous DAX faults

2017-10-19 Thread Christoph Hellwig
> +#define XFS_MAP_SUPPORTED (LEGACY_MAP_MASK | MAP_SYNC) I'd kill this define. Also is there any good reason that we have to add LEGACY_MAP_MASK instead of assuming it's supported in the core? > #endif > .mmap = xfs_file_mmap, > + .mmap_supported_flags = XFS_MAP_SUPPORTED

[PATCH 03/17] dax: Simplify arguments of dax_insert_mapping()

2017-10-19 Thread Jan Kara
dax_insert_mapping() has lots of arguments and a lot of them is actuall duplicated by passing vm_fault structure as well. Change the function to take the same arguments as dax_pmd_insert_mapping(). Reviewed-by: Ross Zwisler Reviewed-by: Christoph Hellwig Signed-off-by: Jan Kara --- fs/dax.c |

Hi

2017-10-19 Thread Bounced mail
The original message was received at Thu, 19 Oct 2017 21:56:53 +0800 from lists.01.org [111.41.225.161] - The following addresses had permanent fatal errors - - Transcript of session follows - while talking to lists.01.org.: >>> MAIL From:"Bounced mail" <<< 501 "Bounced mail"

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

2017-10-19 Thread Dan Williams
On Thu, Oct 19, 2017 at 5:58 AM, Jan Kara wrote: > > From: Dan Williams > > The mmap(2) syscall suffers from the ABI anti-pattern of not validating > unknown flags. However, proposals like MAP_SYNC need a mechanism to > define new behavior that is known to fail on older kernels without the > supp

what happened to byte-addressable read()/write() to character device DAX?

2017-10-19 Thread jane . chu
Hi, Dan, Referring to   https://patchwork.kernel.org/project/linux-nvdimm/list/?page=6   [RFC,2/2] mm, fs: daxfile, an interface for byte-addressable updates to pmem I'm unable to find the patch in Linux upstream kernel, and am wondering if there has been a change of plan for providing supp

Re: [Qemu-devel] [RFC 2/2] KVM: add virtio-pmem driver

2017-10-19 Thread Dan Williams
On Thu, Oct 19, 2017 at 1:01 AM, Christoph Hellwig wrote: > On Wed, Oct 18, 2017 at 08:51:37AM -0700, Dan Williams wrote: >> This use case is not "Persistent Memory". Persistent Memory is >> something you can map and make persistent with CPU instructions. >> Anything that requires a driver call is

转发:致企业的一封信

2017-10-19 Thread 柏系
以下课程上海,深圳,即将主办,席位预定中! 全能型车间主任实战技能 企业安全、环境(EHS)系统化实战训练 详情 请 阅读 附 件 内 容 ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

Re: what happened to byte-addressable read()/write() to character device DAX?

2017-10-19 Thread Jeff Moyer
jane@oracle.com writes: > Hi, Dan, > > Referring to > > https://patchwork.kernel.org/project/linux-nvdimm/list/?page=6 > > [RFC,2/2] mm, fs: daxfile, an interface for byte-addressable updates > to pmem > > I'm unable to find the patch in Linux upstream kernel, and am wondering if > there has b

Re: what happened to byte-addressable read()/write() to character device DAX?

2017-10-19 Thread Dan Williams
On Thu, Oct 19, 2017 at 2:41 PM, Jeff Moyer wrote: > jane@oracle.com writes: > >> Hi, Dan, >> >> Referring to >> >> https://patchwork.kernel.org/project/linux-nvdimm/list/?page=6 >> >> [RFC,2/2] mm, fs: daxfile, an interface for byte-addressable updates >> to pmem >> >> I'm unable to find the

Re: what happened to byte-addressable read()/write() to character device DAX?

2017-10-19 Thread jane . chu
On 10/19/2017 03:33 PM, Dan Williams wrote: On Thu, Oct 19, 2017 at 2:41 PM, Jeff Moyer wrote: jane@oracle.com writes: Hi, Dan, Referring to https://patchwork.kernel.org/project/linux-nvdimm/list/?page=6 [RFC,2/2] mm, fs: daxfile, an interface for byte-addressable updates to pmem I'm

Re: what happened to byte-addressable read()/write() to character device DAX?

2017-10-19 Thread Dan Williams
On Thu, Oct 19, 2017 at 4:59 PM, wrote: [..] > Thank you both for the clarification! > Is there documents that elaborate the new resolve in detail? This might answer some of your questions: https://lwn.net/Articles/731706/ ___ Linux-nvdimm mailing list

Re: [PATCH v2] dev/dax: fix uninitialized variable build warning

2017-10-19 Thread Dan Williams
On Wed, Oct 18, 2017 at 11:21 AM, Ross Zwisler wrote: > Fix this build warning: > > warning: 'phys' may be used uninitialized in this function > [-Wuninitialized] > > As reported here: > > https://lkml.org/lkml/2017/10/16/152 > http://kisskb.ellerman.id.au/kisskb/buildresult/13181373/log/ > > Sign

[PATCH v3 04/13] dax: stop using VM_HUGEPAGE for dax

2017-10-19 Thread Dan Williams
This flag is deprecated in favor of the vma_is_dax() check in transparent_hugepage_enabled() added in commit baabda261424 "mm: always enable thp for dax mappings" Cc: Jeff Moyer Cc: Christoph Hellwig Cc: Ross Zwisler Reviewed-by: Jan Kara Signed-off-by: Dan Williams --- drivers/dax/device.c

[PATCH v3 00/13] dax: fix dma vs truncate and remove 'page-less' support

2017-10-19 Thread Dan Williams
Changes since v2 [1]: * Add 'dax: handle truncate of dma-busy pages' which builds on the removal of page-less dax to fix a latent bug handling dma vs truncate. * Disable get_user_pages_fast() for dax * Disable RDMA memory registrations against filesystem-DAX mappings for non-ODP (On Demand Pagi

[PATCH v3 05/13] dax: stop requiring a live device for dax_flush()

2017-10-19 Thread Dan Williams
Now that dax_flush() is no longer a driver callback (commit c3ca015fab6d "dax: remove the pmem_dax_ops->flush abstraction"), stop requiring the dax_read_lock() to be held and the device to be alive. This is in preparation for switching filesystem-dax to store pfns instead of sectors in the radix.

[PATCH v3 01/13] dax: quiet bdev_dax_supported()

2017-10-19 Thread Dan Williams
Before we add another failure reason, quiet the existing log messages. Leave it to the caller to decide if bdev_dax_supported() failures are errors worth emitting to the log. Reported-by: Jeff Moyer Signed-off-by: Dan Williams --- drivers/dax/super.c |8 1 file changed, 4 insertion

[PATCH v3 03/13] dax: stop using VM_MIXEDMAP for dax

2017-10-19 Thread Dan Williams
VM_MIXEDMAP is used by dax to direct mm paths like vm_normal_page() that the memory page it is dealing with is not typical memory from the linear map. The get_user_pages_fast() path, since it does not resolve the vma, is already using {pte,pmd}_devmap() as a stand-in for VM_MIXEDMAP, so we use that

[PATCH v3 10/13] mm: disable get_user_pages_fast() for dax

2017-10-19 Thread Dan Williams
In preparation for solving the dax-dma vs truncate race, disable get_user_pages_fast(). The race fix relies on the vma being available. We can still support get_user_pages_fast() for 1GB (pud) 'devmap' mappings since those are only implemented for device-dax, everything else needs the vma and the

[PATCH v3 02/13] dax: require 'struct page' for filesystem dax

2017-10-19 Thread Dan Williams
If a dax buffer from a device that does not map pages is passed to read(2) or write(2) as a target for direct-I/O it triggers SIGBUS. If gdb attempts to examine the contents of a dax buffer from a device that does not map pages it triggers SIGBUS. If fork(2) is called on a process with a dax mappin

[PATCH v3 08/13] tools/testing/nvdimm: add 'bio_delay' mechanism

2017-10-19 Thread Dan Williams
In support of testing truncate colliding with dma add a mechanism that delays the completion of block I/O requests by a programmable number of seconds. This allows a truncate operation to be issued while page references are held for direct-I/O. Signed-off-by: Dan Williams --- tools/testing/nvdim

[PATCH v3 09/13] IB/core: disable memory registration of fileystem-dax vmas

2017-10-19 Thread Dan Williams
Until there is a solution to the dma-to-dax vs truncate problem it is not safe to allow RDMA to create long standing memory registrations against filesytem-dax vmas. Device-dax vmas do not have this problem and are explicitly allowed. This is temporary until a "memory registration with layout-leas

[PATCH v3 07/13] dax: warn if dma collides with truncate

2017-10-19 Thread Dan Williams
Catch cases where truncate encounters pages that are still under active dma. This warning is a canary for potential data corruption as truncated blocks could be allocated to a new file while the device is still perform i/o. Cc: Jan Kara Cc: Jeff Moyer Cc: Christoph Hellwig Cc: Matthew Wilcox C

[PATCH v3 12/13] dax: handle truncate of dma-busy pages

2017-10-19 Thread Dan Williams
get_user_pages() pins file backed memory pages for access by dma devices. However, it only pins the memory pages not the page-to-file offset association. If a file is truncated the pages are mapped out of the file and dma may continue indefinitely into a page that is owned by a device driver. This

[PATCH v3 06/13] dax: store pfns in the radix

2017-10-19 Thread Dan Williams
In preparation for examining the busy state of dax pages in the truncate path, switch from sectors to pfns in the radix. Cc: Jan Kara Cc: Jeff Moyer Cc: Christoph Hellwig Cc: Matthew Wilcox Cc: Ross Zwisler Signed-off-by: Dan Williams --- fs/dax.c | 75 +++-

[PATCH v3 13/13] xfs: wire up FL_ALLOCATED support

2017-10-19 Thread Dan Williams
Before xfs can be sure that it is safe to truncate it needs to hold XFS_MMAP_LOCK_EXCL and flush any FL_ALLOCATED leases. Introduce xfs_break_allocated() modeled after xfs_break_layouts() for use in the file space deletion path. We also use a new address_space_operation for the fs/dax core to coo

[PATCH v3 11/13] fs: use smp_load_acquire in break_{layout,lease}

2017-10-19 Thread Dan Williams
Commit 128a37852234 "fs: fix data races on inode->i_flctx" converted checks of inode->i_flctx to use smp_load_acquire(), but it did not convert break_layout(). smp_load_acquire() includes a READ_ONCE(). There should be no functional difference since __break_lease repeats the sequence, but this is a

[PATCH 1/2] dm log writes: Add support for inline data buffers

2017-10-19 Thread Ross Zwisler
Currently dm-log-writes supports writing filesystem data via BIOs, and writing internal metadata from a flat buffer via write_metadata(). For DAX writes, though, we won't have a BIO, but will instead have an iterator that we'll want to use to fill a flat data buffer. So, create write_inline_data(

[PATCH 2/2] dm log writes: add support for DAX

2017-10-19 Thread Ross Zwisler
Now that we have the ability log filesystem writes using a flat buffer, add support for DAX. Unfortunately we can't easily track data that has been written via mmap() now that the dax_flush() abstraction was removed by this commit: commit c3ca015fab6d ("dax: remove the pmem_dax_ops->flush abstrac

[fstests PATCH] generic: add test for DAX MAP_SYNC support

2017-10-19 Thread Ross Zwisler
Add a test that exercises DAX's new MAP_SYNC flag. This test creates a file and writes to it via an mmap(), but never syncs via fsync/msync. This process is tracked via dm-log-writes, then replayed. If MAP_SYNC is working the dm-log-writes replay will show the test file with the same size that w

转发:如何解决销*售【常见问题】

2017-10-19 Thread 杭瘩
如何解决【常见问题】 l 业绩压力大,但要提升业绩又觉得无从下手,怎么办? l 报价后客户就没有回应了,怎么办? l 客户拿着我们的报价与别人比,说我们的价格贵,怎么办? l 与客户联络一段时间了,但客户一直不下单,怎么办? l 提供样品给客户测试后,客户就不理我们了,怎么办? l 开发陌生客户时,有没有好的方法减少电话或邮件的拒绝率? l 收到客户的询盘后,认真分析过客户的需求并回复了,但客户反馈的很少,怎么办? l 如何把老客户的满意度转化为销量? 详细 内容 参阅 附件 大纲 杭瘩 2017-10-20/14:08:34

Re: [fstests PATCH] generic: add test for DAX MAP_SYNC support

2017-10-19 Thread Amir Goldstein
On Fri, Oct 20, 2017 at 8:29 AM, Ross Zwisler wrote: > Add a test that exercises DAX's new MAP_SYNC flag. > > This test creates a file and writes to it via an mmap(), but never syncs > via fsync/msync. This process is tracked via dm-log-writes, then replayed. > > If MAP_SYNC is working the dm-log