From owner-freebsd-virtualization@freebsd.org Wed Oct 7 21:43:56 2015 Return-Path: Delivered-To: freebsd-virtualization@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96B6E9D1199 for ; Wed, 7 Oct 2015 21:43:56 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75B1E179; Wed, 7 Oct 2015 21:43:56 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 27BD1B922; Wed, 7 Oct 2015 17:43:55 -0400 (EDT) From: John Baldwin To: freebsd-virtualization@freebsd.org Cc: Andriy Gapon Subject: Re: bhyve vs host suspend/resume Date: Wed, 07 Oct 2015 14:03:15 -0700 Message-ID: <2376667.56T8bNa9sN@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-PRERELEASE; KDE/4.14.3; amd64; ; ) In-Reply-To: <55A4C942.8060007@FreeBSD.org> References: <55A4C942.8060007@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 07 Oct 2015 17:43:55 -0400 (EDT) X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Oct 2015 21:43:56 -0000 On Tuesday, July 14, 2015 11:33:06 AM Andriy Gapon wrote: > > Not sure if there is anything that bhyve can do about the following, but maybe > it can. It seems that that after a host is suspended for several hours and > resumed while a bhyve VM is running, then time counting becomes rather broken in > the VM. > With Linux VMs I observe that date(1) keeps reporting stale pre-suspend time and > thread scheduling is broken, new processes can not be started, etc. When I've thought about this, my thoughts were to teach bhyve to support S1/S3 suspend (would just need to reset the RTC on resume, not sure what else might need to be done on resume. Ideally the vcpu threads would also idle during suspend). You could then wire up a different signal as a virtual sleep button (similar to how SIGTERM works as a virtual power button) and have hooks in rc.suspend to 'killall -SIGSUSPEND bhyve' and rc.resume to 'killall -SIGRESUME bhyve' or something like that. -- John Baldwin