Re: [PATCH net-next 12/12] tools/virtio: fix smp_mb on x86

2018-01-25 Thread Jason Wang
On 2018年01月26日 07:36, Michael S. Tsirkin wrote: Offset 128 overlaps the last word of the redzone. Use 132 which is always beyond that. Signed-off-by: Michael S. Tsirkin --- tools/virtio/ringtest/main.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [virtio-dev] Re: [PATCH v25 2/2] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-01-25 Thread Wei Wang
On 01/26/2018 10:42 AM, Michael S. Tsirkin wrote: On Fri, Jan 26, 2018 at 09:40:44AM +0800, Wei Wang wrote: On 01/25/2018 09:49 PM, Michael S. Tsirkin wrote: On Thu, Jan 25, 2018 at 05:14:06PM +0800, Wei Wang wrote: The controversy is that the free list is not static once the lock is

Re: [PATCH v24 1/2] mm: support reporting free page blocks

2018-01-25 Thread Wei Wang
On 01/25/2018 09:41 PM, Michael S. Tsirkin wrote: On Wed, Jan 24, 2018 at 06:42:41PM +0800, Wei Wang wrote: 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,

Re: [virtio-dev] Re: [PATCH v25 2/2] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-01-25 Thread Michael S. Tsirkin
On Fri, Jan 26, 2018 at 09:40:44AM +0800, Wei Wang wrote: > On 01/25/2018 09:49 PM, Michael S. Tsirkin wrote: > > On Thu, Jan 25, 2018 at 05:14:06PM +0800, Wei Wang wrote: > > > + > > > +static void report_free_page_func(struct work_struct *work) > > > +{ > > > + struct virtio_balloon *vb; > > > +

Re: [PATCH v25 1/2 RESEND] mm: support reporting free page blocks

2018-01-25 Thread Wei Wang
On 01/26/2018 06:41 AM, Andrew Morton wrote: On Thu, 25 Jan 2018 17:38:27 +0800 Wei Wang wrote: 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

[PATCH net-next 12/12] tools/virtio: fix smp_mb on x86

2018-01-25 Thread Michael S. Tsirkin
Offset 128 overlaps the last word of the redzone. Use 132 which is always beyond that. Signed-off-by: Michael S. Tsirkin --- tools/virtio/ringtest/main.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virtio/ringtest/main.h

[PATCH net-next 10/12] tools/virtio: more stubs to fix tools build

2018-01-25 Thread Michael S. Tsirkin
Signed-off-by: Michael S. Tsirkin --- tools/virtio/linux/kernel.h | 2 +- tools/virtio/linux/thread_info.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 tools/virtio/linux/thread_info.h diff --git a/tools/virtio/linux/kernel.h

[PATCH net-next 09/12] tools/virtio: switch to __ptr_ring_empty

2018-01-25 Thread Michael S. Tsirkin
We don't rely on lockless guarantees, but it seems cleaner than inverting __ptr_ring_peek. Signed-off-by: Michael S. Tsirkin --- tools/virtio/ringtest/ptr_ring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virtio/ringtest/ptr_ring.c

[PATCH net-next 11/12] tools/virtio: copy READ/WRITE_ONCE

2018-01-25 Thread Michael S. Tsirkin
This is to make ptr_ring test build again. Signed-off-by: Michael S. Tsirkin --- tools/virtio/ringtest/main.h | 57 1 file changed, 57 insertions(+) diff --git a/tools/virtio/ringtest/main.h b/tools/virtio/ringtest/main.h index

Re: [PATCH v25 1/2 RESEND] mm: support reporting free page blocks

2018-01-25 Thread Andrew Morton
On Thu, 25 Jan 2018 17:38:27 +0800 Wei Wang wrote: > 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 >

Re: [PATCH v24 1/2] mm: support reporting free page blocks

2018-01-25 Thread Michael S. Tsirkin
On Thu, Jan 25, 2018 at 09:56:01AM -0500, Pankaj Gupta wrote: > > > > > On Wed, Jan 24, 2018 at 06:42:41PM +0800, Wei Wang wrote: > > > 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

Re: [PATCH v24 1/2] mm: support reporting free page blocks

2018-01-25 Thread Pankaj Gupta
> > On Wed, Jan 24, 2018 at 06:42:41PM +0800, Wei Wang wrote: > > 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 > >

[PATCH net] vhost_net: stop device during reset owner

2018-01-25 Thread Jason Wang
We don't stop device before reset owner, this means we could try to serve any virtqueue kick before reset dev->worker. This will result a warn since the work was pending at llist during owner resetting. Fix this by stopping device during owner reset. Reported-by:

Re: [PATCH v25 2/2] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-01-25 Thread Michael S. Tsirkin
On Thu, Jan 25, 2018 at 05:14:06PM +0800, Wei Wang wrote: > 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 pages by sending a new cmd > id to the guest

Re: [PATCH v25 1/2] mm: support reporting free page blocks

2018-01-25 Thread Michael S. Tsirkin
On Thu, Jan 25, 2018 at 05:14:05PM +0800, Wei Wang wrote: > 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

Re: [PATCH v24 1/2] mm: support reporting free page blocks

2018-01-25 Thread Michael S. Tsirkin
On Wed, Jan 24, 2018 at 06:42:41PM +0800, Wei Wang wrote: > 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

Re: [PATCH v24 2/2] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-01-25 Thread Wei Wang
On 01/25/2018 07:28 PM, Tetsuo Handa wrote: On 2018/01/25 12:32, Wei Wang wrote: On 01/25/2018 01:15 AM, Michael S. Tsirkin wrote: On Wed, Jan 24, 2018 at 06:42:42PM +0800, Wei Wang wrote: + +static void report_free_page_func(struct work_struct *work) +{ +struct virtio_balloon *vb; +

Re: [PATCH v24 2/2] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-01-25 Thread Tetsuo Handa
On 2018/01/25 12:32, Wei Wang wrote: > On 01/25/2018 01:15 AM, Michael S. Tsirkin wrote: >> On Wed, Jan 24, 2018 at 06:42:42PM +0800, Wei Wang wrote: >> + >> +static void report_free_page_func(struct work_struct *work) >> +{ >> +struct virtio_balloon *vb; >> +unsigned long flags; >> + >> +

Re: [virtio-dev] [PATCH v25 1/2 RESEND] mm: support reporting free page blocks

2018-01-25 Thread Wei Wang
Hi Michal, On 01/25/2018 05:38 PM, Wei Wang wrote: 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

[PATCH v25 1/2 RESEND] mm: support reporting free page blocks

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

Re: [PATCH v24 2/2] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-01-25 Thread Wei Wang
On 01/25/2018 01:15 AM, Michael S. Tsirkin wrote: On Wed, Jan 24, 2018 at 06:42:42PM +0800, Wei Wang wrote: What is this doing? Basically handling the case where vq is broken? It's kind of ugly to tweak feature bits, most code assumes they never change. Please just return an error to

[PATCH v25 0/2] Virtio-balloon: support free page reporting

2018-01-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 v25 2/2] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-01-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 pages by sending a new cmd id to the guest via the free_page_report_cmd_id configuration register. When the

[PATCH v25 1/2] mm: support reporting free page blocks

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