Re: [PATCH net] vhost_net: fix possible infinite loop

2019-05-14 Thread Jason Wang
On 2019/5/15 上午5:39, Michael S. Tsirkin wrote: Let me try to explain again. At the moment how does handle_tx_copy exit? It's for(;;) so you know you need to look for a break. When reading code you also notice there's a goto done which could exit the loop. if you scan forward you notice that it

Re: [PATCH net] vhost: don't use kmap() to log dirty pages

2019-05-14 Thread Jason Wang
On 2019/5/15 上午6:16, Michael S. Tsirkin wrote: On Mon, May 13, 2019 at 01:27:45AM -0400, Jason Wang wrote: Vhost log dirty pages directly to a userspace bitmap through GUP and kmap_atomic() since kernel doesn't have a set_bit_to_user() helper. This will cause issues for the arch that has virtua

Re: [PATCH v2 7/8] vsock/virtio: increase RX buffer size to 64 KiB

2019-05-14 Thread Jason Wang
On 2019/5/15 上午12:20, Stefano Garzarella wrote: On Tue, May 14, 2019 at 11:38:05AM +0800, Jason Wang wrote: On 2019/5/14 上午1:51, Stefano Garzarella wrote: On Mon, May 13, 2019 at 06:01:52PM +0800, Jason Wang wrote: On 2019/5/10 下午8:58, Stefano Garzarella wrote: In order to increase host -> g

Re: [PATCH v2 1/8] vsock/virtio: limit the memory used per-socket

2019-05-14 Thread Jason Wang
On 2019/5/15 上午12:35, Stefano Garzarella wrote: On Tue, May 14, 2019 at 11:25:34AM +0800, Jason Wang wrote: On 2019/5/14 上午1:23, Stefano Garzarella wrote: On Mon, May 13, 2019 at 05:58:53PM +0800, Jason Wang wrote: On 2019/5/10 下午8:58, Stefano Garzarella wrote: Since virtio-vsock was introdu

Re: [PATCH net] vhost: don't use kmap() to log dirty pages

2019-05-14 Thread Michael S. Tsirkin
On Mon, May 13, 2019 at 01:27:45AM -0400, Jason Wang wrote: > Vhost log dirty pages directly to a userspace bitmap through GUP and > kmap_atomic() since kernel doesn't have a set_bit_to_user() > helper. This will cause issues for the arch that has virtually tagged > caches. The way to fix is to kee

Re: [PATCH net] vhost_net: fix possible infinite loop

2019-05-14 Thread Michael S. Tsirkin
On Mon, May 13, 2019 at 01:42:33PM +0800, Jason Wang wrote: > > On 2019/5/13 上午1:10, Michael S. Tsirkin wrote: > > On Sun, May 05, 2019 at 12:20:24PM +0800, Jason Wang wrote: > > > On 2019/4/26 下午3:35, Jason Wang wrote: > > > > On 2019/4/26 上午1:52, Michael S. Tsirkin wrote: > > > > > On Thu, Apr 2

Re: [PULL] vhost: cleanups and fixes

2019-05-14 Thread pr-tracker-bot
The pull request you sent on Tue, 14 May 2019 17:11:47 -0400: > git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git tags/for_linus has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/35c99ffa20edd3c24be352d28a63cd3a23121282 Thank you! -- Deet-doot-dot, I am a bot

[PULL] vhost: cleanups and fixes

2019-05-14 Thread Michael S. Tsirkin
The following changes since commit e93c9c99a629c61837d5a7fc2120cd2b6c70dbdd: Linux 5.1 (2019-05-05 17:42:58 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git tags/for_linus for you to fetch changes up to 050f4c4d2fbbd8217d94dc21051cc5

Re: [PATCH v2 1/8] vsock/virtio: limit the memory used per-socket

2019-05-14 Thread Stefano Garzarella
On Tue, May 14, 2019 at 11:25:34AM +0800, Jason Wang wrote: > > On 2019/5/14 上午1:23, Stefano Garzarella wrote: > > On Mon, May 13, 2019 at 05:58:53PM +0800, Jason Wang wrote: > > > On 2019/5/10 下午8:58, Stefano Garzarella wrote: > > > > Since virtio-vsock was introduced, the buffers filled by the h

Re: [PATCH v2 7/8] vsock/virtio: increase RX buffer size to 64 KiB

2019-05-14 Thread Stefano Garzarella
On Tue, May 14, 2019 at 11:38:05AM +0800, Jason Wang wrote: > > On 2019/5/14 上午1:51, Stefano Garzarella wrote: > > On Mon, May 13, 2019 at 06:01:52PM +0800, Jason Wang wrote: > > > On 2019/5/10 下午8:58, Stefano Garzarella wrote: > > > > In order to increase host -> guest throughput with large packe

Re: [PATCH v2 8/8] vsock/virtio: make the RX buffer size tunable

2019-05-14 Thread Stefano Garzarella
On Mon, May 13, 2019 at 08:46:19PM +0800, Jason Wang wrote: > > On 2019/5/13 下午6:05, Jason Wang wrote: > > > > On 2019/5/10 下午8:58, Stefano Garzarella wrote: > > > The RX buffer size determines the memory consumption of the > > > vsock/virtio guest driver, so we make it tunable through > > > a mo

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_LEGACY > > > > If unsure, say Y

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

2019-05-14 Thread Randy Dunlap
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_LEGACY > > If unsure, say Y. > > +config

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

[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/dax/sup

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

2019-05-14 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 v9 1/7] libnvdimm: nd_region flush callback support

2019-05-14 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 v9 0/7] virtio pmem driver

2019-05-14 Thread Pankaj Gupta
Hi Dan, Proposing the patch series to be merged via nvdimm tree as kindly agreed by you. We have ack/review on XFS, EXT4 & VIRTIO patches. Incorporated all the changes suggested in v8. This version added a new patch 4 for dax for device mapper change and some minor style changes in patch

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 David Hildenbrand
>> >> 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 care of automatical

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 David Hildenbrand
>> >>> + } >>> + >>> + /* 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 > > creates a nd_region object with t

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

2019-05-14 Thread David Hildenbrand
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 > creates a nd_region object with the persistent memory > range information so that exi