[virtio-dev] Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-03 Thread Michael S. Tsirkin
On Thu, Aug 03, 2017 at 03:20:09PM +, Wang, Wei W wrote: > On Thursday, August 3, 2017 9:51 PM, Michal Hocko: > > As I've said earlier. Start simple optimize incrementally with some numbers > > to > > justify a more subtle code. > > -- > > OK. Let's start with the simple implementation as yo

[virtio-dev] Re: [PATCH v13 3/5] virtio-balloon: VIRTIO_BALLOON_F_SG

2017-08-03 Thread Michael S. Tsirkin
On Thu, Aug 03, 2017 at 03:17:59PM +, Wang, Wei W wrote: > On Thursday, August 3, 2017 10:23 PM, Michael S. Tsirkin wrote: > > On Thu, Aug 03, 2017 at 02:38:17PM +0800, Wei Wang wrote: > > > +static void send_one_sg(struct virtio_balloon *vb, struct virtqueue *vq, > > > + void *

[virtio-dev] RE: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-03 Thread Wang, Wei W
On Thursday, August 3, 2017 9:51 PM, Michal Hocko: > As I've said earlier. Start simple optimize incrementally with some numbers to > justify a more subtle code. > -- OK. Let's start with the simple implementation as you suggested. Best, Wei -

[virtio-dev] RE: [PATCH v13 3/5] virtio-balloon: VIRTIO_BALLOON_F_SG

2017-08-03 Thread Wang, Wei W
On Thursday, August 3, 2017 10:23 PM, Michael S. Tsirkin wrote: > On Thu, Aug 03, 2017 at 02:38:17PM +0800, Wei Wang wrote: > > +static void send_one_sg(struct virtio_balloon *vb, struct virtqueue *vq, > > + void *addr, uint32_t size) > > +{ > > + struct scatterlist sg; > > +

[virtio-dev] Re: [PATCH v13 3/5] virtio-balloon: VIRTIO_BALLOON_F_SG

2017-08-03 Thread Michael S. Tsirkin
On Thu, Aug 03, 2017 at 02:38:17PM +0800, Wei Wang wrote: > Add a new feature, VIRTIO_BALLOON_F_SG, which enables the transfer > of balloon (i.e. inflated/deflated) pages using scatter-gather lists > to the host. > > The implementation of the previous virtio-balloon is not very > efficient, becaus

[virtio-dev] Re: [PATCH v13 5/5] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ

2017-08-03 Thread Wei Wang
On 08/03/2017 09:05 PM, Pankaj Gupta wrote: On 08/03/2017 04:13 PM, Pankaj Gupta wrote: +/* Allocate space for find_vqs parameters */ +vqs = kcalloc(nvqs, sizeof(*vqs), GFP_KERNEL); +if (!vqs) +goto err_vq; +callbacks = kmalloc_array(nvqs, sizeof(*

[virtio-dev] Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-03 Thread Wei Wang
On 08/03/2017 08:41 PM, Michal Hocko wrote: On Thu 03-08-17 20:11:58, Wei Wang wrote: On 08/03/2017 07:28 PM, Michal Hocko wrote: On Thu 03-08-17 19:27:19, Wei Wang wrote: On 08/03/2017 06:44 PM, Michal Hocko wrote: On Thu 03-08-17 18:42:15, Wei Wang wrote: On 08/03/2017 05:11 PM, Michal Hoc

[virtio-dev] Re: [PATCH v13 5/5] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ

2017-08-03 Thread Michael S. Tsirkin
On Thu, Aug 03, 2017 at 02:38:19PM +0800, Wei Wang wrote: > Add a new vq to report hints of guest free pages to the host. > > Signed-off-by: Wei Wang > Signed-off-by: Liang Li > --- > drivers/virtio/virtio_balloon.c | 164 > ++-- > include/uapi/linux/virtio_

[virtio-dev] Re: [PATCH v13 5/5] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_VQ

2017-08-03 Thread Wei Wang
On 08/03/2017 04:13 PM, Pankaj Gupta wrote: +/* Allocate space for find_vqs parameters */ +vqs = kcalloc(nvqs, sizeof(*vqs), GFP_KERNEL); +if (!vqs) +goto err_vq; +callbacks = kmalloc_array(nvqs, sizeof(*callbacks), GFP_KERNEL); +if (!callb

[virtio-dev] Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-03 Thread Wei Wang
On 08/03/2017 07:28 PM, Michal Hocko wrote: On Thu 03-08-17 19:27:19, Wei Wang wrote: On 08/03/2017 06:44 PM, Michal Hocko wrote: On Thu 03-08-17 18:42:15, Wei Wang wrote: On 08/03/2017 05:11 PM, Michal Hocko wrote: On Thu 03-08-17 14:38:18, Wei Wang wrote: [...] +static int report_free_pag

[virtio-dev] Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-03 Thread Wei Wang
On 08/03/2017 06:44 PM, Michal Hocko wrote: On Thu 03-08-17 18:42:15, Wei Wang wrote: On 08/03/2017 05:11 PM, Michal Hocko wrote: On Thu 03-08-17 14:38:18, Wei Wang wrote: [...] +static int report_free_page_block(struct zone *zone, unsigned int order, + unsigne

[virtio-dev] Re: [PATCH v13 4/5] mm: support reporting free page blocks

2017-08-03 Thread Wei Wang
On 08/03/2017 05:11 PM, Michal Hocko wrote: On Thu 03-08-17 14:38:18, 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 the report function returns, so it is the calle