From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33719) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8wfJ-0002rG-3x for qemu-devel@nongnu.org; Thu, 30 Jan 2014 13:48:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W8wfC-0007kq-H0 for qemu-devel@nongnu.org; Thu, 30 Jan 2014 13:48:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:12920) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8wfC-0007kW-7o for qemu-devel@nongnu.org; Thu, 30 Jan 2014 13:48:34 -0500 Date: Thu, 30 Jan 2014 18:48:24 +0000 From: "Dr. David Alan Gilbert" Message-ID: <20140130184823.GJ2655@work-vm> References: <1391105318-23247-1-git-send-email-owasserm@redhat.com> <1391105318-23247-5-git-send-email-owasserm@redhat.com> <20140130182336.GH2655@work-vm> <52EA9D1B.1090305@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52EA9D1B.1090305@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 4/6] XBZRLE cache size should not be larger than guest memory size List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Orit Wasserman Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org, anthony@codemonkey.ws, quintela@redhat.com * Orit Wasserman (owasserm@redhat.com) wrote: > On 01/30/2014 08:23 PM, Dr. David Alan Gilbert wrote: > >* Orit Wasserman (owasserm@redhat.com) wrote: > >>Signed-off-by: Orit Wasserman > >>--- > >> migration.c | 7 +++++++ > >> 1 file changed, 7 insertions(+) > >> > >>diff --git a/migration.c b/migration.c > >>index 46a7305..25add6f 100644 > >>--- a/migration.c > >>+++ b/migration.c > >>@@ -479,6 +479,13 @@ void qmp_migrate_set_cache_size(int64_t value, Error **errp) > >> return; > >> } > >> > >>+ /* Cache should not be larger than guest ram size */ > > > >Why? (It's admittedly odd, but does it actually break something if it's larger?) > > > > Because how XBZRLE works, the idea is that for workload that changes the same pages > frequently, we can reduce the amount of transferred data sent by sending only the diff. > We also compress the diff itself. > > The cache is used to store the previous page so we can calculate the diff, so at most it will > contain all the guest pages. It's a hash based cache though isn't it - so there will be some contention for a cache size==ram size case? Also this does mean that you have to be a little careful to pick a sane XBZRLE cache size, since one that's too large will now fail; I can only see that being a problem on a machine with a mix of huge and tiny VMs. ( I sent the reviewd-by tag separately.) Dave -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK