[PATCH v29 0/4] Virtio-balloon: support free page reporting

2018-03-25 Thread Wei Wang
This patch series is separated from the previous "Virtio-balloon Enhancement" series. The new feature, VIRTIO_BALLOON_F_FREE_PAGE_HINT, implemented by this series enables the virtio-balloon driver to report hints of guest free pages to the host. It can be used to accelerate live migration of

[PATCH v29 1/4] mm: support reporting free page blocks

2018-03-25 Thread Wei Wang
This patch adds support to walk through the free page blocks in the system and report them via a callback function. Some page blocks may leave the free list after zone->lock is released, so it is the caller's responsibility to either detect or prevent the use of such pages. One use example of

[PATCH v29 2/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-03-25 Thread Wei Wang
Negotiation of the VIRTIO_BALLOON_F_FREE_PAGE_HINT feature indicates the support of reporting hints of guest free pages to host via virtio-balloon. Host requests the guest to report free page hints by sending a new cmd id to the guest via the free_page_report_cmd_id configuration register. When

[PATCH v29 4/4] virtio-balloon: VIRTIO_BALLOON_F_PAGE_POISON

2018-03-25 Thread Wei Wang
The VIRTIO_BALLOON_F_PAGE_POISON feature bit is used to indicate if the guest is using page poisoning. Guest writes to the poison_val config field to tell host about the page poisoning value in use. Signed-off-by: Wei Wang Suggested-by: Michael S. Tsirkin

[PATCH v29 3/4] mm/page_poison: expose page_poisoning_enabled to kernel modules

2018-03-25 Thread Wei Wang
In some usages, e.g. virtio-balloon, a kernel module needs to know if page poisoning is in use. This patch exposes the page_poisoning_enabled function to kernel modules. Signed-off-by: Wei Wang Cc: Andrew Morton Cc: Michal Hocko

RE: [PATCH v29 3/4] mm/page_poison: expose page_poisoning_enabled to kernel modules

2018-03-25 Thread Wang, Wei W
On Monday, March 26, 2018 10:40 AM, Wang, Wei W wrote: > Subject: [PATCH v29 3/4] mm/page_poison: expose page_poisoning_enabled > to kernel modules > > In some usages, e.g. virtio-balloon, a kernel module needs to know if page > poisoning is in use. This patch exposes the page_poisoning_enabled

[RFC PATCH V2 2/8] vhost: hide used ring layout from device

2018-03-25 Thread Jason Wang
We used to return descriptor head by vhost_get_vq_desc() to device and pass it back to vhost_add_used() and its friends. This exposes the internal used ring layout to device which makes it hard to be extended for e.g packed ring layout. So this patch tries to hide the used ring layout by -

[RFC PATCH V2 3/8] vhost: do not use vring_used_elem

2018-03-25 Thread Jason Wang
Instead of depending on the exported vring_used_elem, this patch switches to use a new internal structure vhost_used_elem which embed vring_used_elem in itself. This could be used to let vhost to record extra metadata for the incoming packed ring layout. Signed-off-by: Jason Wang

[RFC PATCH V2 5/8] vhost: vhost_put_user() can accept metadata type

2018-03-25 Thread Jason Wang
We assumes used ring update is the only user for vhost_put_user() in the past. This may not be the case for the incoming packed ring which may update the descriptor ring for used. So introduce a new type parameter. Signed-off-by: Jason Wang --- drivers/vhost/vhost.c | 14

[RFC PATCH V2 6/8] virtio: introduce packed ring defines

2018-03-25 Thread Jason Wang
Signed-off-by: Jason Wang --- include/uapi/linux/virtio_config.h | 9 + include/uapi/linux/virtio_ring.h | 13 + 2 files changed, 22 insertions(+) diff --git a/include/uapi/linux/virtio_config.h b/include/uapi/linux/virtio_config.h index

[RFC PATCH V2 4/8] vhost_net: do not explicitly manipulate vhost_used_elem

2018-03-25 Thread Jason Wang
Two helpers of setting/getting used len were introduced to avoid explicitly manipulating vhost_used_elem in zerocopy code. This will be used to hide used_elem internals and simplify packed ring implementation. Signed-off-by: Jason Wang --- drivers/vhost/net.c | 11

[RFC PATCH V2 1/8] vhost: move get_rx_bufs to vhost.c

2018-03-25 Thread Jason Wang
Move get_rx_bufs() to vhost.c and rename it to vhost_get_rx_bufs(). This helps to hide vring internal layout from specific device implementation. Packed ring implementation will benefit from this. Signed-off-by: Jason Wang --- drivers/vhost/net.c | 83

[RFC PATCH V2 0/8] Packed ring for vhost

2018-03-25 Thread Jason Wang
Hi all: This RFC implement packed ring layout. The code were tested with pmd implement by Jens at http://dpdk.org/ml/archives/dev/2018-January/089417.html. Minor change was needed for pmd codes to kick virtqueue since it assumes a busy polling backend. Test were done between localhost and guest.

[RFC PATCH V2 7/8] vhost: packed ring support

2018-03-25 Thread Jason Wang
Signed-off-by: Jason Wang --- drivers/vhost/net.c | 5 +- drivers/vhost/vhost.c | 530 ++ drivers/vhost/vhost.h | 7 +- 3 files changed, 505 insertions(+), 37 deletions(-) diff --git a/drivers/vhost/net.c

[RFC PATCH V2 8/8] vhost: event suppression for packed ring

2018-03-25 Thread Jason Wang
This patch introduces basic support for event suppression aka driver and device area. Compile tested only. Signed-off-by: Jason Wang --- drivers/vhost/vhost.c| 169 --- drivers/vhost/vhost.h| 10 ++-

Re: [RFC PATCH V2 0/8] Packed ring for vhost

2018-03-25 Thread Jason Wang
cc Jens, Tiwei and Wei Thanks On 2018年03月26日 11:38, Jason Wang wrote: Hi all: This RFC implement packed ring layout. The code were tested with pmd implement by Jens at http://dpdk.org/ml/archives/dev/2018-January/089417.html. Minor change was needed for pmd codes to kick virtqueue since it

Re: possible deadlock in handle_rx

2018-03-25 Thread Jason Wang
On 2018年03月26日 08:01, syzbot wrote: Hello, syzbot hit the following crash on upstream commit cb6416592bc2a8b731dabcec0d63cda270764fc6 (Sun Mar 25 17:45:10 2018 +) Merge tag 'dmaengine-fix-4.16-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/slave-dma syzbot dashboard link: