[PATCH v4 0/2] virtio_console: fix replug of virtio console port

2019-08-13 Thread Pankaj Gupta
https://lists.oasis-open.org/archives/virtio-dev/201908/msg00055.html Pankaj Gupta (2): virtio: decrement avail idx with buffer detach for packed ring virtio_console: free unused buffers with port delete char/virtio_console.c | 14 +++--- virtio/virtio_ring.c |6 ++ 2 files

[PATCH v4 2/2] virtio_console: free unused buffers with port delete

2019-08-13 Thread Pankaj Gupta
ttached with the port. Re-plug the same port tries to allocate new buffers in virtqueue and results in this error if queue is full. This patch reverts this commit by removing the unused buffers in vq's when we unplug the port. Reported-by: Xiaohui Li Cc: sta...@vger.kernel.org Signed-off-

[PATCH v4 1/2] virtio: decrement avail idx with buffer detach for packed ring

2019-08-13 Thread Pankaj Gupta
etatched from the vq. Acked-by: Jason Wang Signed-off-by: Pankaj Gupta --- drivers/virtio/virtio_ring.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index c8be1c4f5b55..7c69181113e2 100644 --- a/drivers/virtio/virtio_ring.c

Re: [PATCH v3 2/2] virtio: decrement avail idx with buffer detach for packed ring

2019-08-11 Thread Pankaj Gupta
> > On 2019/8/9 下午2:48, Pankaj Gupta wrote: > > This patch decrements 'next_avail_idx' count when detaching a buffer > > from vq for packed ring code. Split ring code already does this in > > virtqueue_detach_unused_buf_split function. This updates the &g

Re: [PATCH v3 1/2] virtio_console: free unused buffers with port delete

2019-08-11 Thread Pankaj Gupta
> > On Fri, Aug 09, 2019 at 12:18:46PM +0530, Pankaj Gupta wrote: > > The commit a7a69ec0d8e4 ("virtio_console: free buffers after reset") > > deferred detaching of unused buffer to virtio device unplug time. > > This causes unplug/replug of single port in virt

Re: [PATCH v3 2/2] virtio: decrement avail idx with buffer detach for packed ring

2019-08-11 Thread Pankaj Gupta
> On Fri, Aug 09, 2019 at 12:18:47PM +0530, Pankaj Gupta wrote: > > This patch decrements 'next_avail_idx' count when detaching a buffer > > from vq for packed ring code. Split ring code already does this in > > virtqueue_detach_unused_buf_split function. This upda

[PATCH v3 1/2] virtio_console: free unused buffers with port delete

2019-08-08 Thread Pankaj Gupta
tive. Reported-by: Xiaohui Li Fixes: a7a69ec0d8e4 ("virtio_console: free buffers after reset") Cc: sta...@vger.kernel.org Signed-off-by: Pankaj Gupta --- drivers/char/virtio_console.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/driv

[PATCH v3 2/2] virtio: decrement avail idx with buffer detach for packed ring

2019-08-08 Thread Pankaj Gupta
etatched from the vq. Signed-off-by: Pankaj Gupta --- drivers/virtio/virtio_ring.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index c8be1c4f5b55..7c69181113e2 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virt

[PATCH v3 0/2] virtio_console: fix replug of virtio console port

2019-08-08 Thread Pankaj Gupta
info/?l=qemu-devel&m=156471883703948&w=2 [2] https://lkml.org/lkml/2019/3/4/517 Pankaj Gupta (2): virtio_console: free unused buffers with port delete virtio: decrement avail idx with buffer detach for packed ring char/virtio_console.c | 14 +++--- virtio/virtio_ring.c |6 ++ 2

Re: [PATCH v2 2/2] virtio_ring: packed ring: fix virtqueue_detach_unused_buf

2019-08-08 Thread Pankaj Gupta
> On Thu, Aug 08, 2019 at 08:28:46AM -0400, Pankaj Gupta wrote: > > > > > > > > This patch makes packed ring code compatible with split ring in > > > > function > > > > 'virtqueue_detach_unused_buf_*'. > > > > > >

Re: [PATCH v2 2/2] virtio_ring: packed ring: fix virtqueue_detach_unused_buf

2019-08-08 Thread Pankaj Gupta
> > This patch makes packed ring code compatible with split ring in function > > 'virtqueue_detach_unused_buf_*'. > > What does that mean? What does this "fix"? Patch 1 frees the buffers When a port is unplugged from the virtio console device. It does this with the help of 'virtqueue_detach_

Re: [PATCH v2 1/2] virtio_console: free unused buffers with port delete

2019-08-08 Thread Pankaj Gupta
> > On Thu, Aug 08, 2019 at 05:06:05PM +0530, Pankaj Gupta wrote: > > The commit a7a69ec0d8e4 ("virtio_console: free buffers after reset") > > deferred detaching of unused buffer to virtio device unplug time. > > > > This causes unplug/replug

[PATCH v2 0/2] virtio_console: fix replug of virtio console port

2019-08-08 Thread Pankaj Gupta
ed here [1]. Changes from v1[2] - Make virtio packed ring code compatible with split ring - [Michael] [1] https://marc.info/?l=qemu-devel&m=156471883703948&w=2 [2] https://lkml.org/lkml/2019/3/4/517 Pankaj Gupta (2): virtio_console: free unused buffers with port delete virtio_ring

[PATCH v2 1/2] virtio_console: free unused buffers with port delete

2019-08-08 Thread Pankaj Gupta
irtio device is still active. Reported-by: Xiaohui Li Fixes: b3258ff1d6 ("virtio_console: free buffers after reset") Signed-off-by: Pankaj Gupta --- drivers/char/virtio_console.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/char/virtio_console

[PATCH v2 2/2] virtio_ring: packed ring: fix virtqueue_detach_unused_buf

2019-08-08 Thread Pankaj Gupta
This patch makes packed ring code compatible with split ring in function 'virtqueue_detach_unused_buf_*'. Signed-off-by: Pankaj Gupta --- drivers/virtio/virtio_ring.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ri

[PATCH v3] virtio_pmem: fix sparse warning

2019-07-11 Thread Pankaj Gupta
[unsigned] [usertype] ret Reported-by: kbuild test robot Signed-off-by: Pankaj Gupta --- This fixes a warning, so submitting it as a separate patch on top of virtio pmem series. v2-> v3 Use __le for req/resp fields - Michael drivers/nvdimm/nd_virtio.c | 4 ++-- include/uapi/li

Re: [PATCH v2] virtio_pmem: fix sparse warning

2019-07-11 Thread Pankaj Gupta
> > On Wed, Jul 10, 2019 at 11:28:32PM +0530, Pankaj Gupta wrote: > > This patch fixes below sparse warning related to __virtio > > type in virtio pmem driver. This is reported by Intel test > > bot on linux-next tree. > > > > nd_virtio.c:56:28: w

Re: [PATCH] virtio_pmem: fix sparse warning

2019-07-11 Thread Pankaj Gupta
> > On Wed, Jul 10, 2019 at 07:57:00PM +0530, Pankaj Gupta wrote: > > This patch fixes below sparse warning related to __virtio > > type in virtio pmem driver. This is reported by Intel test > > bot on linux-next tree. > > > > nd_virtio.c:56:28: w

[PATCH v2] virtio_pmem: fix sparse warning

2019-07-10 Thread Pankaj Gupta
[unsigned] [usertype] ret Reported-by: kbuild test robot Signed-off-by: Pankaj Gupta --- This fixes a warning, so submitting it as a separate patch on top of virtio pmem series. include/uapi/linux/virtio_pmem.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/uapi

[PATCH] virtio_pmem: fix sparse warning

2019-07-10 Thread Pankaj Gupta
nd_virtio.c:56:28:got restricted __virtio32 nd_virtio.c:93:59: warning: incorrect type in argument 2 (different base types) nd_virtio.c:93:59:expected restricted __virtio32 [usertype] val nd_virtio.c:93:59:got unsigned int [unsigned] [usertype] ret Signed-off-by: Pankaj Gupta Reported-by

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

2019-07-05 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 -

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

2019-07-05 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

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

2019-07-05 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 S

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

2019-07-05 Thread Pankaj Gupta
red to pass 'iterate_devices_fn' as argument so that the callers can pass the appropriate functions. Suggested-by: Mike Snitzer Signed-off-by: Pankaj Gupta Reviewed-by: Mike Snitzer --- drivers/md/dm-table.c | 24 ++-- drivers/md/dm.c | 2 +- drivers/

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

2019-07-05 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|

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

2019-07-05 Thread Pankaj Gupta
orms flush on DAX memory range. Signed-off-by: Pankaj Gupta Reviewed-by: Yuval Shaia Acked-by: Michael S. Tsirkin Acked-by: Jakub Staron Tested-by: Jakub Staron Reviewed-by: Cornelia Huck --- drivers/nvdimm/Makefile | 1 + drivers/nvdimm/nd_virtio.c | 125 +

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

2019-07-05 Thread Pankaj Gupta
ed by host fsync failure to userspace. Signed-off-by: Pankaj Gupta --- drivers/acpi/nfit/core.c | 4 ++-- drivers/nvdimm/claim.c | 6 -- drivers/nvdimm/nd.h | 1 + drivers/nvdimm/pmem.c| 13 - drivers/nvdimm/region_devs.c | 26 -

[PATCH v15 0/7] virtio pmem driver

2019-07-05 Thread Pankaj Gupta
.h - nvdimm_flush() return 0 or -EIO if it fails - Teach nsio_rw_bytes() that the flush can fail - Rename nvdimm_flush() to generic_nvdimm_flush() - Use 'nd_region->provider_data' for long dereferencing - Remove virtio_pmem_freeze/restore functions - Remove BSD license text with SPDX li

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

2019-06-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 -

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

2019-06-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

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

2019-06-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 S

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

2019-06-21 Thread Pankaj Gupta
red to pass 'iterate_devices_fn' as argument so that the callers can pass the appropriate functions. Suggested-by: Mike Snitzer Signed-off-by: Pankaj Gupta Reviewed-by: Mike Snitzer --- drivers/md/dm-table.c | 24 ++-- drivers/md/dm.c | 2 +- drivers/

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

2019-06-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|

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

2019-06-21 Thread Pankaj Gupta
orms flush on DAX memory range. Signed-off-by: Pankaj Gupta Reviewed-by: Yuval Shaia Acked-by: Michael S. Tsirkin Acked-by: Jakub Staron Tested-by: Jakub Staron Reviewed-by: Cornelia Huck --- drivers/nvdimm/Makefile | 1 + drivers/nvdimm/nd_virtio.c | 125 +

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

2019-06-21 Thread Pankaj Gupta
ed by host fsync failure to userspace. Signed-off-by: Pankaj Gupta --- drivers/acpi/nfit/core.c | 4 ++-- drivers/nvdimm/claim.c | 6 -- drivers/nvdimm/nd.h | 1 + drivers/nvdimm/pmem.c| 13 - drivers/nvdimm/region_devs.c | 26 -

[PATCH v14 0/7] virtio pmem driver

2019-06-21 Thread Pankaj Gupta
g nd.h - nvdimm_flush() return 0 or -EIO if it fails - Teach nsio_rw_bytes() that the flush can fail - Rename nvdimm_flush() to generic_nvdimm_flush() - Use 'nd_region->provider_data' for long dereferencing - Remove virtio_pmem_freeze/restore functions - Remove BSD license text with SPDX license

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

2019-06-12 Thread Pankaj Gupta
> > This also provides function to perform guest flush over > > VIRTIO from 'pmem' driver when userspace performs flush > > on DAX memory range. > > > > Signed-off-by: Pankaj Gupta > > Reviewed-by: Yuval Shaia > > Acked-by: Michael S. Tsirkin &

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

2019-06-12 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 -

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

2019-06-12 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

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

2019-06-12 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 S

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

2019-06-12 Thread Pankaj Gupta
red to pass 'iterate_devices_fn' as argument so that the callers can pass the appropriate functions. Suggested-by: Mike Snitzer Signed-off-by: Pankaj Gupta Reviewed-by: Mike Snitzer --- drivers/md/dm-table.c | 24 ++-- drivers/md/dm.c | 2 +- drivers/

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

2019-06-12 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|

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

2019-06-12 Thread Pankaj Gupta
orms flush on DAX memory range. Signed-off-by: Pankaj Gupta Reviewed-by: Yuval Shaia Acked-by: Michael S. Tsirkin Acked-by: Jakub Staron Tested-by: Jakub Staron --- drivers/nvdimm/Makefile | 1 + drivers/nvdimm/nd_virtio.c | 125 +++ drivers/

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

2019-06-12 Thread Pankaj Gupta
ed by host fsync failure to userspace. Signed-off-by: Pankaj Gupta --- drivers/acpi/nfit/core.c | 4 ++-- drivers/nvdimm/claim.c | 6 -- drivers/nvdimm/nd.h | 1 + drivers/nvdimm/pmem.c| 13 - drivers/nvdimm/region_devs.c | 26 -

[PATCH v13 0/7] virtio pmem driver

2019-06-12 Thread Pankaj Gupta
m_flush function - Use indirect call for nvdimm_flush - Don’t move declarations to common global header e.g nd.h - nvdimm_flush() return 0 or -EIO if it fails - Teach nsio_rw_bytes() that the flush can fail - Rename nvdimm_flush() to generic_nvdimm_flush() - Use 'nd_region->provider_da

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

2019-06-12 Thread Pankaj Gupta
> > Hi Pankaj, > > On Tue, 11 Jun 2019 23:34:50 -0400 (EDT) > Pankaj Gupta wrote: > > > Hi Cornelia, > > > > > On Tue, 11 Jun 2019 22:07:57 +0530 > > > Pankaj Gupta wrote: > > > > > > + err1 = virtqueue_kick(vpmem-

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

2019-06-11 Thread Pankaj Gupta
Hi Cornelia, > On Tue, 11 Jun 2019 22:07:57 +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 &g

Re: [Qemu-devel] [PATCH v12 4/7] dm: enable synchronous dax

2019-06-11 Thread Pankaj Gupta
> On Tue, Jun 11 2019 at 12:37pm -0400, > Pankaj Gupta wrote: > > > 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 async

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

2019-06-11 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 -

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

2019-06-11 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

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

2019-06-11 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 S

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

2019-06-11 Thread Pankaj Gupta
red to pass 'iterate_devices_fn' as argument so that the callers can pass the appropriate functions. Suggested-by: Mike Snitzer Signed-off-by: Pankaj Gupta --- drivers/md/dm-table.c | 24 ++-- drivers/md/dm.c | 2 +- drivers/md/dm.h | 5 - 3 files ch

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

2019-06-11 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|

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

2019-06-11 Thread Pankaj Gupta
ed by host fsync failure to userspace. Signed-off-by: Pankaj Gupta --- drivers/acpi/nfit/core.c | 4 ++-- drivers/nvdimm/claim.c | 6 -- drivers/nvdimm/nd.h | 1 + drivers/nvdimm/pmem.c| 13 - drivers/nvdimm/region_devs.c | 26 -

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

2019-06-11 Thread Pankaj Gupta
orms flush on DAX memory range. Signed-off-by: Pankaj Gupta Reviewed-by: Yuval Shaia Acked-by: Michael S. Tsirkin Acked-by: Jakub Staron Tested-by: Jakub Staron --- drivers/nvdimm/Makefile | 1 + drivers/nvdimm/nd_virtio.c | 124 +++ drivers/

[PATCH v12 0/7] virtio pmem driver

2019-06-11 Thread Pankaj Gupta
n - Use indirect call for nvdimm_flush - Don’t move declarations to common global header e.g nd.h - nvdimm_flush() return 0 or -EIO if it fails - Teach nsio_rw_bytes() that the flush can fail - Rename nvdimm_flush() to generic_nvdimm_flush() - Use 'nd_region->provider_data' for long dereferencing - Remo

Re: [Qemu-devel] [PATCH v11 4/7] dm: enable synchronous dax

2019-06-11 Thread Pankaj Gupta
> > > Hi Mike, > > > > Thanks for the review Please find my reply inline. > > > > > > > > dm_table_supports_dax() is called multiple times (from > > > dm_table_set_restrictions and dm_table_determine_type). It is strange > > > to have a getter have a side-effect of being a setter too. Over

Re: [Qemu-devel] [PATCH v11 4/7] dm: enable synchronous dax

2019-06-11 Thread Pankaj Gupta
Hi Mike, Thanks for the review Please find my reply inline. > > dm_table_supports_dax() is called multiple times (from > dm_table_set_restrictions and dm_table_determine_type). It is strange > to have a getter have a side-effect of being a setter too. Overloading > like this could get you in t

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

2019-06-10 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 -

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

2019-06-10 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

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

2019-06-10 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 S

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

2019-06-10 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 --- d

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

2019-06-10 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|

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

2019-06-10 Thread Pankaj Gupta
orms flush on DAX memory range. Signed-off-by: Pankaj Gupta Reviewed-by: Yuval Shaia Acked-by: Michael S. Tsirkin Acked-by: Jakub Staron Tested-by: Jakub Staron --- drivers/nvdimm/Makefile | 1 + drivers/nvdimm/nd_virtio.c | 124 +++ drivers/

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

2019-06-10 Thread Pankaj Gupta
ed by host fsync failure to userspace. Signed-off-by: Pankaj Gupta --- drivers/acpi/nfit/core.c | 4 ++-- drivers/nvdimm/claim.c | 6 -- drivers/nvdimm/nd.h | 1 + drivers/nvdimm/pmem.c| 13 - drivers/nvdimm/region_devs.c | 26 -

[PATCH v11 0/7] virtio pmem driver

2019-06-10 Thread Pankaj Gupta
- nvdimm_flush() return 0 or -EIO if it fails - Teach nsio_rw_bytes() that the flush can fail - Rename nvdimm_flush() to generic_nvdimm_flush() - Use 'nd_region->provider_data' for long dereferencing - Remove virtio_pmem_freeze/restore functions - Remove BSD license text with SPDX licen

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

2019-06-09 Thread Pankaj Gupta
> On Tue, May 21, 2019 at 6:43 AM Pankaj Gupta wrote: > > > > 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 de

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

2019-05-21 Thread Pankaj Gupta
SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ > > +/* > > + * Definitions for virtio-pmem devices. > > + * > > + * Copyright (C) 2019 Red Hat, Inc. > > + * > > + * Author(s): Pankaj Gupta > > + */ > > + > > +#ifndef _UAPI_LINUX_VIRTIO_PMEM_H &

[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 -

[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 S

[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

[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 --- d

[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|

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

2019-05-21 Thread Pankaj Gupta
orms flush on DAX memory range. Signed-off-by: Pankaj Gupta Reviewed-by: Yuval Shaia Acked-by: Michael S. Tsirkin Acked-by: Jakub Staron Tested-by: Jakub Staron --- drivers/nvdimm/Makefile | 1 + drivers/nvdimm/nd_virtio.c | 124 +++ drivers/

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

2019-05-21 Thread Pankaj Gupta
ed by host fsync failure to userspace. Signed-off-by: Pankaj Gupta --- drivers/acpi/nfit/core.c | 4 ++-- drivers/nvdimm/claim.c | 6 -- drivers/nvdimm/nd.h | 1 + drivers/nvdimm/pmem.c| 13 - drivers/nvdimm/region_devs.c | 26 -

[PATCH v10 0/7] virtio pmem driver

2019-05-21 Thread Pankaj Gupta
rovider_data' for long dereferencing - Remove virtio_pmem_freeze/restore functions - Remove BSD license text with SPDX license text - Add might_sleep() in virtio_pmem_flush - [Luiz] - Make spin_lock_irqsave() narrow Pankaj Gupta (7): libnvdimm: nd_region flush callback support virtio-pm

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

2019-05-19 Thread Pankaj Gupta
> > > > On 5/16/19 10:35 PM, Pankaj Gupta wrote: > > > Can I take it your reviewed/acked-by? or tested-by tag? for the virtio > > > patch :)I don't feel that I have enough expertise to give the reviewed-by > > > tag, but you can > > take my ack

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

2019-05-19 Thread Pankaj Gupta
> On 5/16/19 10:35 PM, Pankaj Gupta wrote: > > Can I take it your reviewed/acked-by? or tested-by tag? for the virtio > > patch :)I don't feel that I have enough expertise to give the reviewed-by > > tag, but you can > take my acked-by + tested-by. > > Acked-b

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

2019-05-16 Thread Pankaj Gupta
Hi Jakub, > > On 5/14/19 7:54 AM, Pankaj Gupta wrote: > > + if (!list_empty(&vpmem->req_list)) { > > + req_buf = list_first_entry(&vpmem->req_list, > > + struct virtio_pmem_request,

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

2019-05-16 Thread Pankaj Gupta
> > On Wed, May 15, 2019 at 10:46:00PM +0200, David Hildenbrand wrote: > > > + vpmem->vdev = vdev; > > > + vdev->priv = vpmem; > > > + err = init_vq(vpmem); > > > + if (err) { > > > + dev_err(&vdev->dev, "failed to initialize virtio pmem vq's\n"); > > > + goto out_err; > > > + }

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

2019-05-16 Thread Pankaj Gupta
> >> + vpmem->vdev = vdev; > >> + vdev->priv = vpmem; > >> + err = init_vq(vpmem); > >> + if (err) { > >> + dev_err(&vdev->dev, "failed to initialize virtio pmem vq's\n"); > >> + goto out_err; > >> + } > >> + > >> + virtio_cread(vpmem->vdev, struct virtio_pmem_config, > >>

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

2019-05-16 Thread Pankaj Gupta
> > > + vpmem->vdev = vdev; > > + vdev->priv = vpmem; > > + err = init_vq(vpmem); > > + if (err) { > > + dev_err(&vdev->dev, "failed to initialize virtio pmem vq's\n"); > > + goto out_err; > > + } > > + > > + virtio_cread(vpmem->vdev, struct virtio_pmem_config, >

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

2019-05-15 Thread Pankaj Gupta
ring > > existing flush function. Report error returned by host fsync > > failure to userspace. > > > > Signed-off-by: Pankaj Gupta > > --- > > drivers/acpi/nfit/core.c | 4 ++-- > > drivers/nvdimm/claim.c | 6 -- > > drivers/nvdim

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

2019-05-14 Thread Pankaj Gupta
> On 5/14/19 7:54 AM, Pankaj Gupta wrote: > > diff --git a/drivers/virtio/Kconfig b/drivers/virtio/Kconfig > > index 35897649c24f..94bad084ebab 100644 > > --- a/drivers/virtio/Kconfig > > +++ b/drivers/virtio/Kconfig > > @@ -42,6 +42,17 @@ config VIRTIO_PCI_LEGA

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

2019-05-14 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 -

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

2019-05-14 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

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

2019-05-14 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 S

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

2019-05-14 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 --- d

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

2019-05-14 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|

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

2019-05-14 Thread Pankaj Gupta
orms flush on DAX memory range. Signed-off-by: Pankaj Gupta Reviewed-by: Yuval Shaia Acked-by: Michael S. Tsirkin --- drivers/nvdimm/Makefile | 1 + drivers/nvdimm/nd_virtio.c | 126 +++ drivers/nvdimm/virtio_pmem.c | 122 ++

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

2019-05-14 Thread Pankaj Gupta
ed by host fsync failure to userspace. Signed-off-by: Pankaj Gupta --- drivers/acpi/nfit/core.c | 4 ++-- drivers/nvdimm/claim.c | 6 -- drivers/nvdimm/nd.h | 1 + drivers/nvdimm/pmem.c| 13 - drivers/nvdimm/region_devs.c | 26 -

[PATCH v9 0/7] virtio pmem driver

2019-05-14 Thread Pankaj Gupta
sh can fail - Rename nvdimm_flush() to generic_nvdimm_flush() - Use 'nd_region->provider_data' for long dereferencing - Remove virtio_pmem_freeze/restore functions - Remove BSD license text with SPDX license text - Add might_sleep() in virtio_pmem_flush - [Luiz] - Make spin_lock_irqs

Re: [PATCH v8 2/6] virtio-pmem: Add virtio pmem driver

2019-05-14 Thread Pankaj Gupta
> >> > >> I think you should do the same here, vdev->priv is allocated in > >> virtio_pmem_probe. > >> > >> But maybe I am missing something important here :) > > > > Because virtio_balloon use "kzalloc" for allocation and needs to be freed. > > But virtio pmem uses "devm_kzalloc" which takes ca

Re: [PATCH v8 2/6] virtio-pmem: Add virtio pmem driver

2019-05-14 Thread Pankaj Gupta
> > >> > >>> + } > >>> + > >>> + /* When host has read buffer, this completes via host_ack */ > >> > >> "A host repsonse results in "host_ack" getting called" ... ? > >> > >>> + wait_event(req->host_acked, req->done); > >>> + err = req->ret; > >>> +ret: > >>> + kfree(req); > >>> + return err; >

Re: [PATCH v8 2/6] virtio-pmem: Add virtio pmem driver

2019-05-14 Thread Pankaj Gupta
Hi David, Thank you for the review. > On 10.05.19 17:51, 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 > >

Re: [Qemu-devel] [PATCH v8 3/6] libnvdimm: add dax_dev sync flag

2019-05-13 Thread Pankaj Gupta
> > > > > > Hi Dan, > > > > While testing device mapper with DAX, I faced a bug with the commit: > > > > commit ad428cdb525a97d15c0349fdc80f3d58befb50df > > Author: Dan Williams > > Date: Wed Feb 20 21:12:50 2019 -0800 > > > > When I reverted the condition to old code[1] it worked for me. I >

Re: [Qemu-devel] [PATCH v8 3/6] libnvdimm: add dax_dev sync flag

2019-05-13 Thread Pankaj Gupta
Hi Dan, While testing device mapper with DAX, I faced a bug with the commit: commit ad428cdb525a97d15c0349fdc80f3d58befb50df Author: Dan Williams Date: Wed Feb 20 21:12:50 2019 -0800 When I reverted the condition to old code[1] it worked for me. I am thinking when we map two different devi

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

2019-05-12 Thread Pankaj Gupta
; > VIRTIO from 'pmem' driver when userspace performs flush > > on DAX memory range. > > > > Signed-off-by: Pankaj Gupta > > Reviewed-by: Yuval Shaia > > Acked-by: Michael S. Tsirkin Thank you, Michael. Best regards, Pankaj > > > --- > &

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

2019-05-10 Thread Pankaj Gupta
> > > > Hi Dan, > > > > Thank you for the review. Please see my reply inline. > > > > > > > > Hi Pankaj, > > > > > > Some minor file placement comments below. > > > > Sure. > > > > > > > > On

Re: [Qemu-devel] [PATCH v8 3/6] libnvdimm: add dax_dev sync flag

2019-05-10 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&

  1   2   3   >