From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38564) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKl81-00035b-Gq for qemu-devel@nongnu.org; Tue, 04 Mar 2014 03:55:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WKl7s-0004rm-5A for qemu-devel@nongnu.org; Tue, 04 Mar 2014 03:55:09 -0500 Received: from mail-ea0-x22a.google.com ([2a00:1450:4013:c01::22a]:63671) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKl7r-0004ri-Ue for qemu-devel@nongnu.org; Tue, 04 Mar 2014 03:55:00 -0500 Received: by mail-ea0-f170.google.com with SMTP id g15so185295eak.29 for ; Tue, 04 Mar 2014 00:54:58 -0800 (PST) Date: Tue, 4 Mar 2014 09:54:56 +0100 From: Stefan Hajnoczi Message-ID: <20140304085456.GD25676@stefanha-thinkpad.redhat.com> References: <615092B2FD0E7648B6E4B43E029BCFB84D578044@SZXEMA503-MBS.china.huawei.com> <20140303123234.GC21055@stefanha-thinkpad.redhat.com> <615092B2FD0E7648B6E4B43E029BCFB84D5794D0@SZXEMA503-MBS.china.huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <615092B2FD0E7648B6E4B43E029BCFB84D5794D0@SZXEMA503-MBS.china.huawei.com> Subject: Re: [Qemu-devel] [RFC]VM live snapshot proposal List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Huangpeng (Peter)" Cc: "kwolf@redhat.com" , Pavel Hrdina , Zhanghailiang , KVM devel mailing list , "qemu-devel@nongnu.org" , Paolo Bonzini , Wenchao Xia On Tue, Mar 04, 2014 at 01:02:44AM +0000, Huangpeng (Peter) wrote: > > But back to the options: > > > > If the host has enough free memory to fork QEMU, a small helper process can > > be used to save the copy-on-write memory snapshot (thanks to fork(2) > > semantics). The hard part about the fork(2) approach is that QEMU isn't > > really designed to fork, so work is necessary to reach a quiescent state for the > > child process. > > > > If there is not enough memory to fork, then a synchronous approach to > > catching guest memory writes is needed. I'm not sure if a good mechanism > > for that exists but the simplest would be mprotect(2) and a signal handler > > (which will make the guest run very slowly). > > > > Stefan > > In real production environment, memory over-commit or use as much memory as > possible may be the normal case, so the fork semantics cannot meet the needs. Yes, I think you're right. The fork approach only works in the easy case where there is plenty of free host memory. > Is there any other proposals to implement vm-snapshot? See the discussion by Paolo and Andrea about post-copy migration, which adds kernel memory management features for tracking userspace page faults. Perhaps you can use that infrastructure to trap guest writes. Stefan