RE: [PATCH v6 kernel 3/5] virtio-balloon: speed up inflate/deflate process

2017-02-03 Thread Li, Liang Z
> > > > +static void free_extended_page_bitmap(struct virtio_balloon *vb) { > > + int i, bmap_count = vb->nr_page_bmap; > > + > > + for (i = 1; i < bmap_count; i++) { > > + kfree(vb->page_bitmap[i]); > > + vb->page_bitmap[i] = NULL; > > + vb->nr_page_bmap--; > >

Re: [PATCH v6 kernel 3/5] virtio-balloon: speed up inflate/deflate process

2017-01-20 Thread Michael S. Tsirkin
On Thu, Jan 19, 2017 at 01:44:36AM +, Li, Liang Z wrote: > > > > > + *range = cpu_to_le64((base_pfn << > > > > > + VIRTIO_BALLOON_NR_PFN_BITS) | 0); > > > > > + *(range + 1) = cpu_to_le64(pages); > > > > > + vb->resp_pos += 2; > >

Re: [PATCH v6 kernel 3/5] virtio-balloon: speed up inflate/deflate process

2017-01-20 Thread Dr. David Alan Gilbert
* Liang Li (liang.z...@intel.com) wrote: > +static void free_extended_page_bitmap(struct virtio_balloon *vb) > +{ > + int i, bmap_count = vb->nr_page_bmap; > + > + for (i = 1; i < bmap_count; i++) { > + kfree(vb->page_bitmap[i]); > + vb->page_bitmap[i] = NULL; > +

RE: [PATCH v6 kernel 3/5] virtio-balloon: speed up inflate/deflate process

2017-01-18 Thread Li, Liang Z
> On Wed, Jan 18, 2017 at 04:56:58AM +, Li, Liang Z wrote: > > > > - virtqueue_add_outbuf(vq, &sg, 1, vb, GFP_KERNEL); > > > > - virtqueue_kick(vq); > > > > +static void do_set_resp_bitmap(struct virtio_balloon *vb, > > > > + unsigned long base_pfn, int pages) > > > >

Re: [PATCH v6 kernel 3/5] virtio-balloon: speed up inflate/deflate process

2017-01-18 Thread Michael S. Tsirkin
On Wed, Jan 18, 2017 at 04:56:58AM +, Li, Liang Z wrote: > > > - virtqueue_add_outbuf(vq, &sg, 1, vb, GFP_KERNEL); > > > - virtqueue_kick(vq); > > > +static void do_set_resp_bitmap(struct virtio_balloon *vb, > > > + unsigned long base_pfn, int pages) > > > > > > - /* When host has read

RE: [PATCH v6 kernel 3/5] virtio-balloon: speed up inflate/deflate process

2017-01-17 Thread Li, Liang Z
> > - virtqueue_add_outbuf(vq, &sg, 1, vb, GFP_KERNEL); > > - virtqueue_kick(vq); > > +static void do_set_resp_bitmap(struct virtio_balloon *vb, > > + unsigned long base_pfn, int pages) > > > > - /* When host has read buffer, this completes via balloon_ack */ > > - wait_event(vb->

Re: [PATCH v6 kernel 3/5] virtio-balloon: speed up inflate/deflate process

2017-01-17 Thread Michael S. Tsirkin
On Wed, Dec 21, 2016 at 02:52:26PM +0800, Liang Li wrote: > > - /* We should always be able to add one buffer to an empty queue. */ > - virtqueue_add_outbuf(vq, &sg, 1, vb, GFP_KERNEL); > - virtqueue_kick(vq); > +static void do_set_resp_bitmap(struct virtio_balloon *vb, > +

[PATCH v6 kernel 3/5] virtio-balloon: speed up inflate/deflate process

2016-12-20 Thread Liang Li
The implementation of the current virtio-balloon is not very efficient, the time spends on different stages of inflating the balloon to 7GB of a 8GB idle guest: a. allocating pages (6.5%) b. sending PFNs to host (68.3%) c. address translation (6.1%) d. madvise (19%) It takes about 4126ms for the