From: "Li, Liang Z" <liang.z.li@intel.com>
To: Andrea Arcangeli <aarcange@redhat.com>,
"Hansen, Dave" <dave.hansen@intel.com>
Cc: David Hildenbrand <david@redhat.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"mhocko@suse.com" <mhocko@suse.com>,
"mst@redhat.com" <mst@redhat.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"dgilbert@redhat.com" <dgilbert@redhat.com>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"virtualization@lists.linux-foundation.org"
<virtualization@lists.linux-foundation.org>,
"kirill.shutemov@linux.intel.com"
<kirill.shutemov@linux.intel.com>
Subject: RE: [Qemu-devel] [PATCH kernel v5 0/5] Extend virtio-balloon for fast (de)inflating & fast live migration
Date: Sat, 17 Dec 2016 12:39:01 +0000 [thread overview]
Message-ID: <F2CBF3009FA73547804AE4C663CAB28E3C32C4D5@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <20161216160112.GC6168@redhat.com>
> Subject: Re: [Qemu-devel] [PATCH kernel v5 0/5] Extend virtio-balloon for
> fast (de)inflating & fast live migration
>
> On Thu, Dec 15, 2016 at 05:40:45PM -0800, Dave Hansen wrote:
> > On 12/15/2016 05:38 PM, Li, Liang Z wrote:
> > >
> > > Use 52 bits for 'pfn', 12 bits for 'length', when the 12 bits is not long
> enough for the 'length'
> > > Set the 'length' to a special value to indicate the "actual length in next 8
> bytes".
> > >
> > > That will be much more simple. Right?
> >
> > Sounds fine to me.
> >
>
> Sounds fine to me too indeed.
>
> I'm only wondering what is the major point for compressing gpfn+len in
> 8 bytes in the common case, you already use sg_init_table to send down two
> pages, we could send three as well and avoid all math and bit shifts and ors,
> or not?
>
Yes, we can use more pages for that.
> I agree with the above because from a performance prospective I tend to
> think the above proposal will run at least theoretically faster because the
> other way is to waste double amount of CPU cache, and bit mangling in the
> encoding and the later decoding on qemu side should be faster than
> accessing an array of double size, but then I'm not sure if it's measurable
> optimization. So I'd be curious to know the exact motivation and if it is to
> reduce the CPU cache usage or if there's some other fundamental reason to
> compress it.
> The header already tells qemu how big is the array payload, couldn't we just
> add more pages if one isn't enough?
>
The original intention to compress the PFN and length it's to reduce the memory required.
Even the code was changed a lot from the previous versions, I think this is still true.
Now we allocate a specified buffer size to save the 'PFN|length', when the buffer is not big
enough to save all the page info for a specified order. A double size buffer will be allocated.
This is what we want to avoid because the allocation may fail and allocation takes some time,
for fast live migration, time is a critical factor we have to consider, more time takes means
more unnecessary pages are sent, because live migration starts before the request for unused
pages get response.
Thanks
Liang
> Thanks,
> Andrea
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2016-12-17 12:39 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-30 8:43 Liang Li
2016-11-30 8:43 ` [PATCH kernel v5 1/5] virtio-balloon: rework deflate to add page to a list Liang Li
2016-11-30 8:43 ` [PATCH kernel v5 2/5] virtio-balloon: define new feature bit and head struct Liang Li
2016-11-30 8:43 ` [PATCH kernel v5 3/5] virtio-balloon: speed up inflate/deflate process Liang Li
2016-11-30 8:43 ` [PATCH kernel v5 4/5] virtio-balloon: define flags and head for host request vq Liang Li
2016-11-30 8:43 ` [PATCH kernel v5 5/5] virtio-balloon: tell host vm's unused page info Liang Li
2016-11-30 19:15 ` Dave Hansen
2016-12-04 13:13 ` Li, Liang Z
2016-12-05 17:22 ` Dave Hansen
2016-12-06 4:47 ` Li, Liang Z
2016-12-06 8:40 ` [PATCH kernel v5 0/5] Extend virtio-balloon for fast (de)inflating & fast live migration David Hildenbrand
2016-12-07 13:35 ` Li, Liang Z
2016-12-07 15:34 ` Dave Hansen
2016-12-09 3:09 ` Li, Liang Z
2016-12-07 15:42 ` David Hildenbrand
2016-12-07 15:45 ` Dave Hansen
2016-12-07 16:21 ` David Hildenbrand
2016-12-07 16:57 ` Dave Hansen
2016-12-07 18:38 ` [Qemu-devel] " Andrea Arcangeli
2016-12-07 18:44 ` Dave Hansen
2016-12-07 18:58 ` Andrea Arcangeli
2016-12-07 19:54 ` Dave Hansen
2016-12-07 20:28 ` Andrea Arcangeli
2016-12-09 4:45 ` Li, Liang Z
2016-12-09 4:53 ` Dave Hansen
2016-12-09 5:35 ` Li, Liang Z
2016-12-09 16:42 ` Andrea Arcangeli
2016-12-14 8:20 ` Li, Liang Z
2016-12-14 8:59 ` Li, Liang Z
2016-12-15 15:34 ` Dave Hansen
2016-12-15 15:54 ` Michael S. Tsirkin
2016-12-16 1:12 ` Li, Liang Z
2016-12-16 15:40 ` Andrea Arcangeli
2016-12-17 11:56 ` Li, Liang Z
2016-12-16 0:48 ` Li, Liang Z
2016-12-16 1:09 ` Dave Hansen
2016-12-16 1:38 ` Li, Liang Z
2016-12-16 1:40 ` Dave Hansen
2016-12-16 1:43 ` Li, Liang Z
2016-12-16 16:01 ` Andrea Arcangeli
2016-12-17 12:39 ` Li, Liang Z [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=F2CBF3009FA73547804AE4C663CAB28E3C32C4D5@shsmsx102.ccr.corp.intel.com \
--to=liang.z.li@intel.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=dave.hansen@intel.com \
--cc=david@redhat.com \
--cc=dgilbert@redhat.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox