From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:44655) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ri7lr-0000YJ-EN for qemu-devel@nongnu.org; Tue, 03 Jan 2012 12:03:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ri7lp-0005i1-MC for qemu-devel@nongnu.org; Tue, 03 Jan 2012 12:03:31 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35390) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ri7lp-0005hx-ED for qemu-devel@nongnu.org; Tue, 03 Jan 2012 12:03:29 -0500 Message-ID: <4F0334AD.7070603@redhat.com> Date: Tue, 03 Jan 2012 19:02:37 +0200 From: Orit Wasserman MIME-Version: 1.0 References: <1325604879-15862-1-git-send-email-owasserm@redhat.com> <4F032DA7.30803@codemonkey.ws> In-Reply-To: <4F032DA7.30803@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v5 0/9] XBZRLE delta for live migration of large memory apps List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: quintela@redhat.com, stefanha@gmail.com, qemu-devel@nongnu.org, blauwirbel@gmail.com, Petter Svard , Benoit Hudzia , Aidan Shribman On 01/03/2012 06:32 PM, Anthony Liguori wrote: > On 01/03/2012 09:34 AM, Orit Wasserman wrote: >> Changes from v4: >> 1) Rebase >> 2) divide patch into 9 patches >> 3) move memory allocation into cache_insert >> >> By using XBZRLE (Xor Binary Zero Run-Length-Encoding) we can reduce VM downtime >> and total live-migration time of VMs running memory write intensive workloads >> typical of large enterprise applications such as SAP ERP Systems, and generally >> speaking for any application with a sparse memory update pattern. >> >> On the sender side XBZRLE is used as a compact delta encoding of page updates, >> retrieving the old page content from an LRU cache (default size of 64 MB). The >> receiving side uses the existing page content and XBZRLE to decode the new page >> content. >> >> Work was originally based on research results published VEE 2011: Evaluation of >> Delta Compression Techniques for Efficient Live Migration of Large Virtual >> Machines by Benoit, Svard, Tordsson and Elmroth. Additionally the delta encoder >> XBRLE was improved further using XBZRLE instead. >> >> XBZRLE has a sustained bandwidth of 2-2.5 GB/s for typical workloads making it >> ideal for in-line, real-time encoding such as is needed for live-migration. >> >> A typical usage scenario: >> {qemu} migrate_set_cachesize 256m > > How does one intelligently choose a cache size? How bad is it to choose the wrong cache size? If the cache you chose is was too big than you just wasted some memory (probably small amount for extra 100M it is around 12K). If the cache is too small than you are not using the full capability , if you will enlarge the cache you can compress more pages. you still get performance benefits but you will get more if had chosen bigger cache. > >> {qemu} migrate -x -d tcp:destination.host:4444 > > We need to make this a negotiated feature, not a requirement for the user to figure out. > > Please go back to the previous thread for more details on this. I will update the patch for the feature to be negotiable. > > Regards, > > Anthony Liguori > >> {qemu} info migrate >> ... >> transferred ram-duplicate: A kbytes >> transferred ram-duplicate: B pages >> transferred ram-normal: C kbytes >> transferred ram-normal: D pages >> transferred ram-xbrle: E kbytes >> transferred ram-xbrle: F pages >> overflow ram-xbrle: G pages >> cache-hit ram-xbrle: H pages >> cache-lookup ram-xbrle: J pages >> >> Testing: live migration with XBZRLE completed in 110 seconds, without live >> migration was not able to complete. >> >> A simple synthetic memory r/w load generator: >> .. include >> .. include >> .. int main() >> .. { >> .. char *buf = (char *) calloc(4096, 4096); >> .. while (1) { >> .. int i; >> .. for (i = 0; i< 4096 * 4; i++) { >> .. buf[i * 4096 / 4]++; >> .. } >> .. printf("."); >> .. } >> .. } >> >> Signed-off-by: Benoit Hudzia >> Signed-off-by: Petter Svard >> Signed-off-by: Aidan Shribman >> >> arch_init.c | 546 +++++++++++++++++++++++++++++++++++++++++++++++++---- >> block-migration.c | 4 +- >> hmp-commands.hx | 34 +++- >> hw/hw.h | 4 +- >> migration.c | 51 +++++- >> migration.h | 19 ++ >> qmp-commands.hx | 44 ++++- >> savevm.c | 11 +- >> sysemu.h | 4 +- >> 9 files changed, 653 insertions(+), 64 deletions(-) >> >