[virtio-dev] 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--; > >

[virtio-dev] 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 +0000, Li, Liang Z wrote: > > > > - virtqueue_add_outbuf(vq, , 1, vb, GFP_KERNEL); > > > > - virtqueue_kick(vq); > > > > +static void do_set_resp_bitmap(struct virtio_balloon *vb, > > > >

RE: [virtio-dev] Re: [PATCH v6 kernel 2/5] virtio-balloon: define new feature bit and head struct

2017-01-18 Thread Li, Liang Z
> > > > > > Signed-off-by: Liang Li > > > > > > Cc: Michael S. Tsirkin > > > > > > Cc: Paolo Bonzini > > > > > > Cc: Cornelia Huck > > > > > > Cc: Amit Shah > > > > > > Cc: Dave Hansen

[virtio-dev] RE: [PATCH v6 kernel 0/5] Extend virtio-balloon for fast (de)inflating & fast live migration

2017-01-18 Thread Li, Liang Z
> Am 21.12.2016 um 07:52 schrieb Liang Li: > > This patch set contains two parts of changes to the virtio-balloon. > > > > One is the change for speeding up the inflating & deflating process, > > the main idea of this optimization is to use {pfn|length} to present > > the page information instead

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

2017-01-17 Thread Li, Liang Z
> > - virtqueue_add_outbuf(vq, , 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 */ > > -

RE: [virtio-dev] Re: [PATCH v6 kernel 2/5] virtio-balloon: define new feature bit and head struct

2017-01-13 Thread Li, Liang Z
> On Wed, Dec 21, 2016 at 02:52:25PM +0800, Liang Li wrote: > > Add a new feature which supports sending the page information with > > range array. The current implementation uses PFNs array, which is not > > very efficient. Using ranges can improve the performance of > > inflating/deflating

[virtio-dev] RE: [PATCH v6 kernel 0/5] Extend virtio-balloon for fast (de)inflating & fast live migration

2017-01-09 Thread Li, Liang Z
Hi guys, Could you help to review this patch set? Thanks! Liang > -Original Message- > From: Li, Liang Z > Sent: Wednesday, December 21, 2016 2:52 PM > To: k...@vger.kernel.org > Cc: virtio-dev@lists.oasis-open.org; qemu-de...@nongnu.org; linux- > m...@kv

[virtio-dev] RE: [PATCH kernel v5 0/5] Extend virtio-balloon for fast (de)inflating & fast live migration

2016-12-08 Thread Li, Liang Z
> Subject: Re: [PATCH kernel v5 0/5] Extend virtio-balloon for fast > (de)inflating > & fast live migration > > On 12/07/2016 05:35 AM, Li, Liang Z wrote: > >> Am 30.11.2016 um 09:43 schrieb Liang Li: > >> IOW in real examples, do we have really large consecu

[virtio-dev] RE: [PATCH kernel v5 0/5] Extend virtio-balloon for fast (de)inflating & fast live migration

2016-12-07 Thread Li, Liang Z
> Am 30.11.2016 um 09:43 schrieb Liang Li: > > This patch set contains two parts of changes to the virtio-balloon. > > > > One is the change for speeding up the inflating & deflating process, > > the main idea of this optimization is to use bitmap to send the page > > information to host instead

[virtio-dev] RE: [PATCH kernel v5 5/5] virtio-balloon: tell host vm's unused page info

2016-12-05 Thread Li, Liang Z
> >>> + mutex_lock(>balloon_lock); > >>> + > >>> + for (order = MAX_ORDER - 1; order >= 0; order--) { > >> > >> I scratched my head for a bit on this one. Why are you walking over > >> orders, > >> *then* zones. I *think* you're doing it because you can efficiently > >> fill the bitmaps at a

[virtio-dev] RE: [PATCH kernel v4 7/7] virtio-balloon: tell host vm's unused page info

2016-11-07 Thread Li, Liang Z
> On 11/06/2016 07:37 PM, Li, Liang Z wrote: > >> Let's say we do a 32k bitmap that can hold ~1M pages. That's 4GB of RAM. > >> On a 1TB system, that's 256 passes through the top-level loop. > >> The bottom-level lists have tens of thousands of pages in them, even

[virtio-dev] RE: [PATCH kernel v4 7/7] virtio-balloon: tell host vm's unused page info

2016-11-06 Thread Li, Liang Z
> Please squish this and patch 5 together. It makes no sense to separate them. > OK. > > +static void send_unused_pages_info(struct virtio_balloon *vb, > > + unsigned long req_id) > > +{ > > + struct scatterlist sg_in; > > + unsigned long pfn = 0, bmap_len,

[virtio-dev] RE: [RESEND PATCH v3 kernel 0/7] Extend virtio-balloon for fast (de)inflating & fast live migration

2016-10-26 Thread Li, Liang Z
.@redhat.com > Subject: Re: [RESEND PATCH v3 kernel 0/7] Extend virtio-balloon for fast > (de)inflating & fast live migration > > On 10/26/2016 03:13 AM, Li, Liang Z wrote: > > 3 times memory required is not accurate, please ignore this. sorry ... > > The complexity is the

[virtio-dev] RE: [RESEND PATCH v3 kernel 0/7] Extend virtio-balloon for fast (de)inflating & fast live migration

2016-10-23 Thread Li, Liang Z
> On Fri, Oct 21, 2016 at 10:25:21AM -0700, Dave Hansen wrote: > > On 10/20/2016 11:24 PM, Liang Li wrote: > > > Dave Hansen suggested a new scheme to encode the data structure, > > > because of additional complexity, it's not implemented in v3. > > > > So, what do you want done with this patch

[virtio-dev] RE: [PATCH v3 kernel 0/7] Extend virtio-balloon for fast (de)inflating & fast live migration

2016-08-31 Thread Li, Liang Z
> Subject: Re: [PATCH v3 kernel 0/7] Extend virtio-balloon for fast > (de)inflating > & fast live migration > > 2016-08-08 14:35 GMT+08:00 Liang Li : > > This patch set contains two parts of changes to the virtio-balloon. > > > > One is the change for speeding up the

[virtio-dev] RE: [PATCH v3 kernel 0/7] Extend virtio-balloon for fast (de)inflating & fast live migration

2016-08-17 Thread Li, Liang Z
Hi Michael, Could you help to review this version when you have time? Thanks! Liang > -Original Message- > From: Li, Liang Z > Sent: Monday, August 08, 2016 2:35 PM > To: linux-ker...@vger.kernel.org > Cc: virtualizat...@lists.linux-foundation.org; linux...@kvack.o

[virtio-dev] RE: [PATCH v3 kernel 0/7] Extend virtio-balloon for fast (de)inflating & fast live migration

2016-08-08 Thread Li, Liang Z
> Subject: Re: [PATCH v3 kernel 0/7] Extend virtio-balloon for fast > (de)inflating > & fast live migration > > On 08/07/2016 11:35 PM, Liang Li wrote: > > Dave Hansen suggested a new scheme to encode the data structure, > > because of additional complexity, it's not implemented in v3. > >

RE: [virtio-dev] Re: [PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate process

2016-07-28 Thread Li, Liang Z
> > > On Wed, Jul 27, 2016 at 09:03:21AM -0700, Dave Hansen wrote: > > > > On 07/26/2016 06:23 PM, Liang Li wrote: > > > > > + vb->pfn_limit = VIRTIO_BALLOON_PFNS_LIMIT; > > > > > + vb->pfn_limit = min(vb->pfn_limit, get_max_pfn()); > > > > > + vb->bmap_len = ALIGN(vb->pfn_limit,

RE: [virtio-dev] Re: [PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate process

2016-07-28 Thread Li, Liang Z
> On Thu, Jul 28, 2016 at 06:36:18AM +0000, Li, Liang Z wrote: > > > > > This ends up doing a 1MB kmalloc() right? That seems a _bit_ big. > > > > > How big was the pfn buffer before? > > > > > > > > Yes, it is if the max pfn is more than 3

[virtio-dev] RE: [PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate process

2016-07-28 Thread Li, Liang Z
> On Thu, Jul 28, 2016 at 03:06:37AM +0000, Li, Liang Z wrote: > > > > + * VIRTIO_BALLOON_PFNS_LIMIT is used to limit the size of page > > > > +bitmap > > > > + * to prevent a very large page bitmap, there are two reasons for this: > > > > + *

[virtio-dev] RE: [PATCH v2 repost 7/7] virtio-balloon: tell host vm's free page info

2016-07-28 Thread Li, Liang Z
> > } > > > > +static void update_free_pages_stats(struct virtio_balloon *vb, > > why _stats? Will change. > > + max_pfn = get_max_pfn(); > > + mutex_lock(>balloon_lock); > > + while (pfn < max_pfn) { > > + memset(vb->page_bitmap, 0, vb->bmap_len); > > + ret =

[virtio-dev] RE: [PATCH v2 repost 6/7] mm: add the related functions to get free page info

2016-07-27 Thread Li, Liang Z
> On 07/27/2016 03:05 PM, Michael S. Tsirkin wrote: > > On Wed, Jul 27, 2016 at 09:40:56AM -0700, Dave Hansen wrote: > >> On 07/26/2016 06:23 PM, Liang Li wrote: > >>> + for_each_migratetype_order(order, t) { > >>> + list_for_each(curr, >free_area[order].free_list[t]) { > >>> +

[virtio-dev] RE: [PATCH v2 repost 4/7] virtio-balloon: speed up inflate/deflate process

2016-07-27 Thread Li, Liang Z
> > + * VIRTIO_BALLOON_PFNS_LIMIT is used to limit the size of page bitmap > > + * to prevent a very large page bitmap, there are two reasons for this: > > + * 1) to save memory. > > + * 2) allocate a large bitmap may fail. > > + * > > + * The actual limit of pfn is determined by: > > + *

[virtio-dev] RE: [PATCH v2 kernel 0/7] Extend virtio-balloon for fast (de)inflating & fast live migration

2016-07-21 Thread Li, Liang Z
Hi Michael, If you have time, could you help to review this patch set? Thanks! Liang > -Original Message- > From: Li, Liang Z > Sent: Wednesday, June 29, 2016 6:32 PM > To: m...@redhat.com > Cc: linux-ker...@vger.kernel.org; virtualizat...@lists.linux-foun

[virtio-dev] RE: [PATCH v2 kernel 0/7] Extend virtio-balloon for fast (de)inflating & fast live migration

2016-07-05 Thread Li, Liang Z
Ping ... Liang > -Original Message- > From: Li, Liang Z > Sent: Wednesday, June 29, 2016 6:32 PM > To: m...@redhat.com > Cc: linux-ker...@vger.kernel.org; virtualizat...@lists.linux-foundation.org; > k...@vger.kernel.org; qemu-de...@nongnu.org; virtio-dev@lists.oasis-

[virtio-dev] RE: [PATCH 2/6] virtio-balloon: speed up inflate/deflate process

2016-06-24 Thread Li, Liang Z
Hi Michael, Thanks for your comments! > > 2<< 30 is 2G but that is not a useful comment. > pls explain what is the reason for this selection. > Will change in the next version. > > +struct balloon_bmap_hdr { > > + __virtio32 id; > > + __virtio32 page_shift; > > + __virtio64 start_pfn;

[virtio-dev] RE: [PATCH 1/6] virtio-balloon: rework deflate to add page to a list

2016-06-23 Thread Li, Liang Z
Hi Michael, Could you help to review this patch set and give some comments when you have time? My work is blocked here. Thanks ! Liang > -Original Message- > From: Li, Liang Z > Sent: Monday, June 13, 2016 5:47 PM > To: k...@vger.kernel.org > Cc: virtio-dev@lists.oasis

[virtio-dev] RE: [PATCH 0/6] Fast balloon & fast live migration

2016-06-23 Thread Li, Liang Z
Any comments? Liang > -Original Message- > From: Li, Liang Z > Sent: Monday, June 13, 2016 5:47 PM > To: k...@vger.kernel.org > Cc: virtio-dev@lists.oasis-open.org; qemu-de...@nongun.org; linux- > ker...@vger.kernel.org; m...@redhat.com; Li, Liang Z > Subject: [PA