[virtio-dev] [PATCH v1 4/4] virtio-balloon: Don't skip free pages if the poison val is non-zero

2018-01-16 Thread Wei Wang
If the guest is using a non-zero poisoning, we don't skip the transfer of guest free pages. Todo: As a next step optimization, we can try 1) skip the transfer of guest poisoned free pages; 2) send the poison value to destination; and 3) seek a way to poison the guest free pages before the guest

[virtio-dev] [PATCH v1 1/4] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ

2018-01-16 Thread Wei Wang
The new feature enables the virtio-balloon device to receive the hint of guest free pages from the free page vq, and clears the corresponding bits of the free page from the dirty bitmap, so that those free pages are not transferred by the migration thread. Without this feature, to local live

[virtio-dev] [PATCH v1 2/4] migration: call balloon to clear bits of free pages from dirty bitmap

2018-01-16 Thread Wei Wang
When migration starts, call the related balloon functions to clear the bits of guest free pages from the dirty bitmap. The dirty bitmap should be ready to use when sending pages to the destination, so stop the guest from reporting free pages before sending pages. Signed-off-by: Wei Wang

[virtio-dev] [PATCH v1 0/4] virtio-balloon: support free page reporting

2018-01-16 Thread Wei Wang
This is the deivce part implementation to add a new feature, VIRTIO_BALLOON_F_FREE_PAGE_VQ to the virtio-balloon device. The device receives the guest free page hint from the driver and clears the corresponding bits in the dirty bitmap, so that those free pages are not transferred to the

[virtio-dev] [PATCH v1 3/4] virtio-balloon: add a timer to limit the free page report wating time

2018-01-16 Thread Wei Wang
This patch adds a timer to limit the time that the host waits for the free pages reported by the guest. Users can specify the time in ms via "free-page-wait-time" command line option. If a user doesn't specify a time, the host waits till the guest finishes reporting all the free pages. The policy

[virtio-dev] [PATCH v22 0/3] Virtio-balloon: support free page reporting

2018-01-16 Thread Wei Wang
This patch series is separated from the previous "Virtio-balloon Enhancement" series. The new feature, VIRTIO_BALLOON_F_FREE_PAGE_VQ, 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 VMs.

[virtio-dev] [PATCH v22 1/3] mm: support reporting free page blocks

2018-01-16 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

[virtio-dev] [PATCH v22 3/3] virtio-balloon: don't report free pages when page poisoning is enabled

2018-01-16 Thread Wei Wang
The guest free pages should not be discarded by the live migration thread when page poisoning is enabled with PAGE_POISONING_NO_SANITY=n, because skipping the transfer of such poisoned free pages will trigger false positive when new pages are allocated and checked on the destination. This patch

[virtio-dev] [PATCH v22 2/3] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ

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

[virtio-dev] Re: [RFC 3/3] vhost-user: add VFIO based accelerators support

2018-01-16 Thread Tiwei Bie
On Tue, Jan 16, 2018 at 10:23:39AM -0700, Alex Williamson wrote: > On Fri, 22 Dec 2017 14:41:51 +0800 > Tiwei Bie wrote: > > > Signed-off-by: Tiwei Bie > > --- > > docs/interop/vhost-user.txt| 57 ++ > > hw/vfio/common.c | 2 +-

[virtio-dev] Re: [RFC PATCH v2 2/5] iommu/virtio-iommu: Add probe request

2018-01-16 Thread Auger Eric
Hi Jean-Philippe, On 17/11/17 19:52, Jean-Philippe Brucker wrote: > When the device offers the probe feature, send a probe request for each > device managed by the IOMMU. Extract RESV_MEM information. When we > encounter a MSI doorbell region, set it up as a IOMMU_RESV_MSI region. > This will

[virtio-dev] Re: [RFC PATCH v2 3/5] iommu/virtio-iommu: Add event queue

2018-01-16 Thread Jean-Philippe Brucker
On 16/01/18 10:10, Auger Eric wrote: > Hi, > > On 17/11/17 19:52, Jean-Philippe Brucker wrote: >> The event queue offers a way for the device to report access faults from >> devices. > end points? Yes [...] >> +static void viommu_event_handler(struct virtqueue *vq) >> +{ >> +int ret; >> +

[virtio-dev] Re: [RFC PATCH v2 2/5] iommu/virtio-iommu: Add probe request

2018-01-16 Thread Jean-Philippe Brucker
On 16/01/18 09:25, Auger Eric wrote: [...] >> +static int viommu_add_resv_mem(struct viommu_endpoint *vdev, >> + struct virtio_iommu_probe_resv_mem *mem, >> + size_t len) >> +{ >> +struct iommu_resv_region *region = NULL; >> +unsigned

[virtio-dev] Re: [RFC PATCH v2 1/5] iommu: Add virtio-iommu driver

2018-01-16 Thread Jean-Philippe Brucker
On 15/01/18 15:12, Auger Eric wrote: [...] >> +/* >> + * viommu_get_req_size - compute request size >> + * >> + * A virtio-iommu request is split into one device-read-only part (top) and >> one >> + * device-write-only part (bottom). Given a request, return the sizes of >> the two >> + * parts

[virtio-dev] Re: [RFC PATCH v2 2/5] iommu/virtio-iommu: Add probe request

2018-01-16 Thread Auger Eric
Hi Jean-Philippe, On 17/11/17 19:52, Jean-Philippe Brucker wrote: > When the device offers the probe feature, send a probe request for each > device managed by the IOMMU. Extract RESV_MEM information. When we > encounter a MSI doorbell region, set it up as a IOMMU_RESV_MSI region. > This will