Re: [Qemu-devel] [PATCH v7 2/6] virtio-pmem: Add virtio pmem driver

2019-04-29 Thread Yuval Shaia
On Fri, Apr 26, 2019 at 10:30:35AM +0530, Pankaj Gupta wrote: > This patch adds virtio-pmem driver for KVM guest. > > Guest reads the persistent memory range information from > Qemu over VIRTIO and registers it on nvdimm_bus. It also > creates a nd_region object with the persistent memory > range

Delivery reports about your e-mail

2019-04-29 Thread The Post Office
The original message was received at Tue, 30 Apr 2019 12:01:36 +0800 from lists.01.org [88.237.50.30] - The following addresses had permanent fatal errors - ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org

[PATCH 10/18] dax: replace mmap entry in case of CoW

2019-04-29 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues We replace the existing entry to the newly allocated one in case of CoW. Also, we mark the entry as PAGECACHE_TAG_TOWRITE so writeback marks this entry as writeprotected. This helps us snapshots so new write pagefaults after snapshots trigger a CoW. btrfs does not

[PATCH 13/18] fs: dedup file range to use a compare function

2019-04-29 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues With dax we cannot deal with readpage() etc. So, we create a funciton callback to perform the file data comparison and pass it to generic_remap_file_range_prep() so it can use iomap-based functions. This may not be the best way to solve this. Suggestions welcome.

[PATCH 18/18] btrfs: trace functions for btrfs_iomap_begin/end

2019-04-29 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues This is for debug purposes only and can be skipped. Signed-off-by: Goldwyn Rodrigues --- fs/btrfs/dax.c | 3 +++ include/trace/events/btrfs.h | 56 2 files changed, 59 insertions(+) diff --git

[PATCH 16/18] btrfs: Writeprotect mmap pages on snapshot

2019-04-29 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues Inorder to make sure mmap'd files don't change after snapshot, writeprotect the mmap pages on snapshot. This is done by performing a data writeback on the pages (which simply mark the pages are wrprotected). This way if the user process tries to access the memory we will

[PATCH 09/18] btrfs: Add dax specific address_space_operations

2019-04-29 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues Signed-off-by: Goldwyn Rodrigues --- fs/btrfs/inode.c | 34 +++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index af4b56cba104..05714ffc4894 100644 --- a/fs/btrfs/inode.c +++

[PATCH 08/18] dax: memcpy page in case of IOMAP_DAX_COW for mmap faults

2019-04-29 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues Change dax_iomap_pfn to return the address as well in order to use it for performing a memcpy in case the type is IOMAP_DAX_COW. We don't handle PMD because btrfs does not support hugepages. Question: The sequence of bdev_dax_pgoff() and dax_direct_access() is used

[PATCH 12/18] btrfs: allow MAP_SYNC mmap

2019-04-29 Thread Goldwyn Rodrigues
From: Adam Borowski Used by userspace to detect DAX. [rgold...@suse.com: Added CONFIG_FS_DAX around mmap_supported_flags] Signed-off-by: Adam Borowski Signed-off-by: Goldwyn Rodrigues --- fs/btrfs/file.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c

[PATCH 06/18] btrfs: Rename __endio_write_update_ordered() to btrfs_update_ordered_extent()

2019-04-29 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues Since we will be using it in another part of the code, use a better name to declare it non-static Signed-off-by: Goldwyn Rodrigues --- fs/btrfs/ctree.h | 7 +-- fs/btrfs/inode.c | 14 +- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git

[PATCH 14/18] dax: memcpy before zeroing range

2019-04-29 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues However, this needed more iomap fields, so it was easier to pass iomap and compute inside the function rather than passing a log of arguments. Note, there is subtle difference between iomap_sector and dax_iomap_sector(). Can we replace dax_iomap_sector with

[PATCH 03/18] btrfs: basic dax read

2019-04-29 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues Perform a basic read using iomap support. The btrfs_iomap_begin() finds the extent at the position and fills the iomap data structure with the values. Signed-off-by: Goldwyn Rodrigues --- fs/btrfs/Makefile | 1 + fs/btrfs/ctree.h | 5 + fs/btrfs/dax.c| 49

[PATCH 11/18] btrfs: add dax mmap support

2019-04-29 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues Add a new vm_operations struct btrfs_dax_vm_ops specifically for dax files. Since we will be removing(nulling) readpages/writepages for dax return ENOEXEC only for non-dax files. Signed-off-by: Goldwyn Rodrigues --- fs/btrfs/ctree.h | 1 + fs/btrfs/dax.c | 13

[PATCH 17/18] btrfs: Disable dax-based defrag and send

2019-04-29 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues This is temporary, and a TODO. Signed-off-by: Goldwyn Rodrigues --- fs/btrfs/ioctl.c | 13 + fs/btrfs/send.c | 4 2 files changed, 17 insertions(+) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 5ebb52848d5a..2470f90c9983 100644 ---

[PATCH 01/18] btrfs: create a mount option for dax

2019-04-29 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues This sets S_DAX in inode->i_flags, which can be used with IS_DAX(). The dax option is restricted to non multi-device mounts. dax interacts with the device directly instead of using bio, so all bio-hooks which we use for multi-device cannot be performed here. While

[PATCH 04/18] dax: Introduce IOMAP_DAX_COW to CoW edges during writes

2019-04-29 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues The IOMAP_DAX_COW is a iomap type which performs copy of edges of data while performing a write if start/end are not page aligned. The source address is expected in iomap->inline_data. dax_copy_edges() is a helper functions performs a copy from one part of the device to

[PATCH 15/18] btrfs: handle dax page zeroing

2019-04-29 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues btrfs_dax_zero_block() zeros part of the page, either from the front or the regular rest of the block. Signed-off-by: Goldwyn Rodrigues --- fs/btrfs/ctree.h | 1 + fs/btrfs/dax.c | 27 ++- fs/btrfs/inode.c | 4 3 files changed, 31

[PATCH v4 00/18] btrfs dax support

2019-04-29 Thread Goldwyn Rodrigues
This patch set adds support for dax on the BTRFS filesystem. In order to support for CoW for btrfs, there were changes which had to be made to the dax handling. The important one is copying blocks into the same dax device before using them which is performed by iomap type IOMAP_DAX_COW.

[PATCH 02/18] btrfs: Carve out btrfs_get_extent_map_write() out of btrfs_get_blocks_write()

2019-04-29 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues This makes btrfs_get_extent_map_write() independent of Direct I/O code. Signed-off-by: Goldwyn Rodrigues --- fs/btrfs/ctree.h | 2 ++ fs/btrfs/inode.c | 40 +++- 2 files changed, 29 insertions(+), 13 deletions(-) diff --git

[PATCH 07/18] btrfs: add dax write support

2019-04-29 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues IOMAP_DAX_COW allows to inform the dax code, to first perform a copy which are not page-aligned before performing the write. The responsibility of checking if data edges are page aligned is performed in ->iomap_begin() and the source address is stored in ->inline_data A

[PATCH 05/18] btrfs: return whether extent is nocow or not

2019-04-29 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues We require this to make sure we return type IOMAP_DAX_COW in iomap structure, in the later patches. Signed-off-by: Goldwyn Rodrigues --- fs/btrfs/ctree.h | 2 +- fs/btrfs/inode.c | 9 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git