Re: [PATCH] mm/nvdimm: Use correct #defines instead of opencoding

2019-05-21 Thread Dan Williams
On Mon, May 13, 2019 at 9:46 PM Aneesh Kumar K.V wrote: > > On 5/14/19 9:42 AM, Dan Williams wrote: > > On Mon, May 13, 2019 at 9:05 PM Aneesh Kumar K.V > > wrote: > >> > >> On 5/14/19 9:28 AM, Dan Williams wrote: > >>> On Mon, May 13, 2019 at 7:56 PM Aneesh Kumar K.V > >>> wrote: > >

Re: [PATCH] mm/nvdimm: Use correct #defines instead of opencoding

2019-05-21 Thread Aneesh Kumar K.V
Dan Williams writes: > On Mon, May 13, 2019 at 9:46 PM Aneesh Kumar K.V > wrote: >> >> On 5/14/19 9:42 AM, Dan Williams wrote: >> > On Mon, May 13, 2019 at 9:05 PM Aneesh Kumar K.V >> > wrote: >> >> >> >> On 5/14/19 9:28 AM, Dan Williams wrote: >> >>> On Mon, May 13, 2019 at 7:56 PM Aneesh Kuma

[PATCH v10 0/7] virtio pmem driver

2019-05-21 Thread Pankaj Gupta
This patch series is ready to be merged via nvdimm tree as discussed with Dan. We have ack/review on XFS, EXT4 & VIRTIO patches. Need an ack on device mapper change in patch 4. Mike, Can you please review patch 4 which has change for dax with device mapper. Incorporated all the changes sug

[PATCH v10 1/7] libnvdimm: nd_region flush callback support

2019-05-21 Thread Pankaj Gupta
This patch adds functionality to perform flush from guest to host over VIRTIO. We are registering a callback based on 'nd_region' type. virtio_pmem driver requires this special flush function. For rest of the region types we are registering existing flush function. Report error returned by host fsy

[PATCH v10 2/7] virtio-pmem: Add virtio pmem driver

2019-05-21 Thread Pankaj Gupta
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 information so that existing 'nvdimm/pmem' driver can reserve this into sy

[PATCH v10 3/7] libnvdimm: add dax_dev sync flag

2019-05-21 Thread Pankaj Gupta
This patch adds 'DAXDEV_SYNC' flag which is set for nd_region doing synchronous flush. This later is used to disable MAP_SYNC functionality for ext4 & xfs filesystem for devices don't support synchronous flush. Signed-off-by: Pankaj Gupta --- drivers/dax/bus.c| 2 +- drivers/dax/sup

[PATCH v10 4/7] dm: enable synchronous dax

2019-05-21 Thread Pankaj Gupta
This patch sets dax device 'DAXDEV_SYNC' flag if all the target devices of device mapper support synchrononous DAX. If device mapper consists of both synchronous and asynchronous dax devices, we don't set 'DAXDEV_SYNC' flag. Signed-off-by: Pankaj Gupta --- drivers/md/dm-table.c | 14 +++

[PATCH v10 5/7] dax: check synchronous mapping is supported

2019-05-21 Thread Pankaj Gupta
This patch introduces 'daxdev_mapping_supported' helper which checks if 'MAP_SYNC' is supported with filesystem mapping. It also checks if corresponding dax_device is synchronous. Virtio pmem device is asynchronous and does not not support VM_SYNC. Suggested-by: Jan Kara Signed-off-by: Pankaj Gup

[PATCH v10 6/7] ext4: disable map_sync for async flush

2019-05-21 Thread Pankaj Gupta
Dont support 'MAP_SYNC' with non-DAX files and DAX files with asynchronous dax_device. Virtio pmem provides asynchronous host page cache flush mechanism. We don't support 'MAP_SYNC' with virtio pmem and ext4. Signed-off-by: Pankaj Gupta Reviewed-by: Jan Kara --- fs/ext4/file.c | 10 ++

[PATCH v10 7/7] xfs: disable map_sync for async flush

2019-05-21 Thread Pankaj Gupta
Dont support 'MAP_SYNC' with non-DAX files and DAX files with asynchronous dax_device. Virtio pmem provides asynchronous host page cache flush mechanism. We don't support 'MAP_SYNC' with virtio pmem and xfs. Signed-off-by: Pankaj Gupta Reviewed-by: Darrick J. Wong --- fs/xfs/xfs_file.c | 9

Re: [PATCH v10 2/7] virtio-pmem: Add virtio pmem driver

2019-05-21 Thread Michael S. Tsirkin
On Tue, May 21, 2019 at 07:07:08PM +0530, Pankaj Gupta wrote: > diff --git a/include/uapi/linux/virtio_pmem.h > b/include/uapi/linux/virtio_pmem.h > new file mode 100644 > index ..7a3e2fe52415 > --- /dev/null > +++ b/include/uapi/linux/virtio_pmem.h > @@ -0,0 +1,35 @@ > +/* SPDX-Licens

RE: [PATCH] mm/nvdimm: Use correct #defines instead of opencoding

2019-05-21 Thread Elliott, Robert (Servers)
> -Original Message- > From: Linux-nvdimm On Behalf Of > Aneesh Kumar K.V > Sent: Tuesday, May 21, 2019 4:51 AM > Subject: Re: [PATCH] mm/nvdimm: Use correct #defines instead of > opencoding > ... > @@ -36,6 +36,9 @@ struct nd_pfn_sb { > __le32 end_trunc; > /* minor-version

Re: [PATCH v2 02/30] fuse: Clear setuid bit even in cache=never path

2019-05-21 Thread Vivek Goyal
On Mon, May 20, 2019 at 04:41:37PM +0200, Miklos Szeredi wrote: > On Wed, May 15, 2019 at 03:26:47PM -0400, Vivek Goyal wrote: > > If fuse daemon is started with cache=never, fuse falls back to direct IO. > > In that write path we don't call file_remove_privs() and that means setuid > > bit is not

Re: [PATCH 03/18] btrfs: basic dax read

2019-05-21 Thread Darrick J. Wong
On Mon, Apr 29, 2019 at 12:26:34PM -0500, Goldwyn Rodrigues wrote: > 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 > ---

Re: [PATCH] mm/nvdimm: Use correct #defines instead of opencoding

2019-05-21 Thread Dan Williams
On Tue, May 21, 2019 at 2:51 AM Aneesh Kumar K.V wrote: > > Dan Williams writes: > > > On Mon, May 13, 2019 at 9:46 PM Aneesh Kumar K.V > > wrote: > >> > >> On 5/14/19 9:42 AM, Dan Williams wrote: > >> > On Mon, May 13, 2019 at 9:05 PM Aneesh Kumar K.V > >> > wrote: > >> >> > >> >> On 5/14/19 9

Re: [Qemu-devel] [PATCH v10 2/7] virtio-pmem: Add virtio pmem driver

2019-05-21 Thread Pankaj Gupta
> > diff --git a/include/uapi/linux/virtio_pmem.h > > b/include/uapi/linux/virtio_pmem.h > > new file mode 100644 > > index ..7a3e2fe52415 > > --- /dev/null > > +++ b/include/uapi/linux/virtio_pmem.h > > @@ -0,0 +1,35 @@ > > +/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ > >

Re: [v6 3/3] device-dax: "Hotremove" persistent memory that is used like normal RAM

2019-05-21 Thread Dan Williams
On Fri, May 17, 2019 at 2:54 PM Pavel Tatashin wrote: > > It is now allowed to use persistent memory like a regular RAM, but > currently there is no way to remove this memory until machine is > rebooted. > > This work expands the functionality to also allows hotremoving > previously hotplugged per

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

2019-05-21 Thread Darrick J. Wong
On Mon, Apr 29, 2019 at 12:26:35PM -0500, Goldwyn Rodrigues wrote: > 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_

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

2019-05-21 Thread Darrick J. Wong
On Mon, Apr 29, 2019 at 12:26:38PM -0500, Goldwyn Rodrigues wrote: > 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 perf

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

2019-05-21 Thread Darrick J. Wong
On Mon, Apr 29, 2019 at 12:26:45PM -0500, Goldwyn Rodrigues wrote: > 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_s

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

2019-05-21 Thread Darrick J. Wong
On Mon, Apr 29, 2019 at 12:26:41PM -0500, Goldwyn Rodrigues wrote: > 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

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

2019-05-21 Thread Darrick J. Wong
On Mon, Apr 29, 2019 at 12:26:39PM -0500, Goldwyn Rodrigues wrote: > 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. > >

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

2019-05-21 Thread Darrick J. Wong
[add Ted to the thread] On Mon, Apr 29, 2019 at 12:26:32PM -0500, Goldwyn Rodrigues wrote: > 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 in

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

2019-05-21 Thread Darrick J. Wong
On Mon, Apr 29, 2019 at 12:26:44PM -0500, Goldwyn Rodrigues wrote: > 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 > functi

Re: [PATCH v2] libnvdimm/pmem: Bypass CONFIG_HARDENED_USERCOPY overhead

2019-05-21 Thread Sasha Levin
Hi, [This is an automated email] This commit has been processed because it contains a "Fixes:" tag, fixing commit: 0aed55af8834 x86, uaccess: introduce copy_from_iter_flushcache for pmem / cache-bypass operations. The bot has tested the following trees: v5.1.3, v5.0.17, v4.19.44, v4.14.120. v5

Re: [PATCH] mm/nvdimm: Use correct #defines instead of opencoding

2019-05-21 Thread Aneesh Kumar K.V
On 5/21/19 9:37 PM, Dan Williams wrote: On Tue, May 21, 2019 at 2:51 AM Aneesh Kumar K.V wrote: Something like the below (Not tested). I am not sure what we will init the page_size for minor version < 3. This will mark the namespace disabled if the PAGE_SIZE and sizeof(struct page) d

[RFC PATCH 3/3] mm/nvdimm: Use correct #defines instead of opencoding

2019-05-21 Thread Aneesh Kumar K.V
The nfpn related change is needed to fix the kernel message "number of pfns truncated from 2617344 to 163584" The change makes sure the nfpns stored in the superblock is right value. Signed-off-by: Aneesh Kumar K.V --- drivers/nvdimm/label.c | 2 +- drivers/nvdimm/pfn_devs.c| 6 +++--

[RFC PATCH 1/3] mm/nvdimm: Add PFN_MIN_VERSION support

2019-05-21 Thread Aneesh Kumar K.V
This allows us to make changes in a backward incompatible way. I have kept the PFN_MIN_VERSION in this patch '0' because we are not introducing any incompatible changes in this patch. We also may want to backport this to older kernels. Signed-off-by: Aneesh Kumar K.V --- drivers/nvdimm/pfn.h

[RFC PATCH 2/3] mm/nvdimm: Add page size and struct page size to pfn superblock

2019-05-21 Thread Aneesh Kumar K.V
This is needed so that we don't wrongly initialize a namespace which doesn't have enough space reserved for holding struct pages with the current kernel. We also increment PFN_MIN_VERSION to make sure that older kernel won't initialize namespace created with newer kernel. Signed-off-by: Aneesh Ku

Re: [RFC PATCH 1/3] mm/nvdimm: Add PFN_MIN_VERSION support

2019-05-21 Thread Aneesh Kumar K.V
On 5/22/19 11:50 AM, Aneesh Kumar K.V wrote: This allows us to make changes in a backward incompatible way. I have kept the PFN_MIN_VERSION in this patch '0' because we are not introducing any incompatible changes in this patch. We also may want to backport this to older kernels. Signed-off-by: