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

2019-08-13 Thread Pankaj Gupta
s-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 changed, 17 insert

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

2019-08-13 Thread Pankaj Gupta
ed 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-by: Pankaj

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

2019-08-13 Thread Pankaj Gupta
. 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 +++ b/drivers/virtio

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 > > 'n

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 updates th

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

2019-08-09 Thread Pankaj Gupta
orted-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/drivers/char/v

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

2019-08-09 Thread Pankaj Gupta
. 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/virtio_ring.c @@ -1537,6

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

2019-08-09 Thread Pankaj Gupta
1883703948=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 files changed, 17

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_*'. > > > > > > What does

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

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 unplu

[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=156471883703948=2 [2] https://lkml.org/lkml/2019/3/4/517 Pankaj Gupta (2): virtio_console: free unused buffers with port delete virtio_ring: packed

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

2019-08-08 Thread Pankaj Gupta
vice 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.c b/drive

[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_ring.c index

[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

[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 --- fs/xfs/xfs_file.c | 9

[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 --- fs/ext4/file.c | 10

[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 Signed-off-by: Pankaj

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

2019-07-05 Thread Pankaj Gupta
' 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/md/dm.h | 5 - 3 files changed, 23

[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| 2 +- drivers

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

2019-07-05 Thread Pankaj Gupta
. 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 +++ drivers/nvdimm

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

2019-07-05 Thread Pankaj Gupta
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 -- include

[PATCH v15 0/7] virtio pmem driver

2019-07-05 Thread Pankaj Gupta
imm_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_irqsave() narrow Pankaj Gupta (7): libnvdimm: nd_region flush

[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 --- fs/xfs/xfs_file.c | 9

[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 --- fs/ext4/file.c | 10

[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 Signed-off-by: Pankaj

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

2019-06-21 Thread Pankaj Gupta
' 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/md/dm.h | 5 - 3 files changed, 23

[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| 2 +- drivers

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

2019-06-21 Thread Pankaj Gupta
. 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 +++ drivers/nvdimm

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

2019-06-21 Thread Pankaj Gupta
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 -- include

[PATCH v14 0/7] virtio pmem driver

2019-06-21 Thread Pankaj Gupta
_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_irqsave() narrow Pankaj Gupta (7): libnvdimm: nd_region flush callba

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

2019-06-12 Thread Pankaj Gupta
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 > > Acked-by: Jakub Staro

[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 --- fs/xfs/xfs_file.c | 9

[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 --- fs/ext4/file.c | 10

[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 Signed-off-by: Pankaj

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

2019-06-12 Thread Pankaj Gupta
' 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/md/dm.h | 5 - 3 files changed, 23

[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| 2 +- drivers

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

2019-06-12 Thread Pankaj Gupta
. 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/nvdimm/virtio_pmem.c | 122

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

2019-06-12 Thread Pankaj Gupta
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 -- include

[PATCH v13 0/7] virtio pmem driver

2019-06-12 Thread Pankaj Gupta
n 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 text - Add might_sleep

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 al

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 asynchronous da

[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 --- fs/xfs/xfs_file.c | 9

[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 --- fs/ext4/file.c | 10

[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 Signed-off-by: Pankaj

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

2019-06-11 Thread Pankaj Gupta
' 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 changed, 23 insertions(+), 8 deletions(-) diff

[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| 2 +- drivers

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

2019-06-11 Thread Pankaj Gupta
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 -- include

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

2019-06-11 Thread Pankaj Gupta
. 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/nvdimm/virtio_pmem.c | 122

[PATCH v12 0/7] virtio pmem driver

2019-06-11 Thread Pankaj Gupta
ils - 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 text - Add might_sleep() in virtio_pmem_flush - [Luiz] - Make spin_loc

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.

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

[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 --- fs/xfs/xfs_file.c | 9

[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 --- fs/ext4/file.c | 10

[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 Signed-off-by: Pankaj

[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 --- drivers/md/dm-table.c | 14

[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| 2 +- drivers

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

2019-06-10 Thread Pankaj Gupta
. 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/nvdimm/virtio_pmem.c | 122

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

2019-06-10 Thread Pankaj Gupta
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 -- include

[PATCH v11 0/7] virtio pmem driver

2019-06-10 Thread Pankaj Gupta
_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_irqsave() narrow Pankaj Gupta (7): libnvdimm: nd_region flush cal

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 devices, >

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 --- fs/xfs/xfs_file.c | 9

[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

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

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

2019-05-21 Thread Pankaj Gupta
. 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/nvdimm/virtio_pmem.c | 122

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

2019-05-21 Thread Pankaj Gupta
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 -- include

[PATCH v10 0/7] virtio pmem driver

2019-05-21 Thread Pankaj Gupta
ight_sleep() in virtio_pmem_flush - [Luiz] - Make spin_lock_irqsave() narrow Pankaj Gupta (7): libnvdimm: nd_region flush callback support virtio-pmem: Add virtio-pmem guest driver libnvdimm: add nd_region buffered dax_dev flag dax: check synchronous mapping is supported dm: dm: Enab

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

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-by: Ja

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(>req_list)) { > > + req_buf = list_first_entry(>req_list, > > + struct virtio_pmem_request, list); > > +

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(>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(>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(>dev, "failed to initialize virtio pmem vq's\n"); > > + goto out_err; > > + } > > + > > + virtio_cread(vpmem->vdev, struct virtio_pmem_config, > > +

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 --- fs/xfs/xfs_file.c | 9

[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 --- fs/ext4/file.c | 10

[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 Signed-off-by: Pankaj

[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 --- drivers/md/dm-table.c | 14

[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| 2 +- drivers

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

2019-05-14 Thread Pankaj Gupta
. 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 ++ drivers/nvdimm/virtio_pmem.h

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

2019-05-14 Thread Pankaj Gupta
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 -- include

[PATCH v9 0/7] virtio pmem driver

2019-05-14 Thread Pankaj Gupta
- 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-pmem: Add virtio-pmem guest driver libnvdim

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

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

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

2019-05-12 Thread Pankaj Gupta
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 > > > --- > > drivers/nvdimm/Makefile

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't support

Re: [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't support > > synchronous flush. > > > &g

  1   2   3   >