From owner-freebsd-hackers@freebsd.org Tue Aug 23 05:23:16 2016 Return-Path: Delivered-To: freebsd-hackers@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 4B1EBBC3D1B for ; Tue, 23 Aug 2016 05:23:16 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2EF5914B1 for ; Tue, 23 Aug 2016 05:23:15 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [192.168.1.10] (unknown [192.168.1.10]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id B79D81B15 for ; Tue, 23 Aug 2016 05:23:09 +0000 (UTC) Subject: Re: Info about suspend-to-disk To: freebsd-hackers@freebsd.org References: <141b1050-8fb5-e8c7-0e0f-50607f2f28b9@metricspace.net> From: Allan Jude Message-ID: <7a9fcbee-c849-d2b7-6608-732c29fab539@freebsd.org> Date: Tue, 23 Aug 2016 01:23:06 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2016 05:23:16 -0000 On 2016-08-23 01:14, Conrad Meyer wrote: > Hi Eric, > > On Mon, Aug 22, 2016 at 8:41 PM, Eric McCorkle wrote: >> Hi everyone, >> >> I'm gathering information in preparation for possibly working on >> suspend-to-disk functionality. I have a fairly good idea of what it >> would take and one way to attack it. The overall plan would look >> something like this: >> >> * Use dump functionality to write an entire OS image out to disk. As >> this is a voluntary dump, it should be possible to go through the FS >> interface to produce a regular file. >> >> * Modify boot1 to check for saved images. Load and resume if one exists. > > That sort of thing should probably go in loader, not boot1. (boot0-2 > are just the MBR boot block(s), as I understand it; loader is the last > pre-OS stage and where most features live.) > * boot0 (512b) is the MBR/pMBR * boot1 (512b) is the VBR (loads and executes boot2) * boot2 (15kb for UFS+MBR, up to 512kb for GPT, 3.5mb of ZFS) is the first thing that actually understands file systems. This reads the loader from the file system * loader (boot3) But I agree, I don't think you'll need to make it any earlier than the loader to do a resume from suspend-to-disk. It can reload the in-memory image, and then start it executing again. >> * Presumably there would need to be some new device methods added to do >> saving/reinitialization of devices. > > Probably similar problems to kexec/kboot. (That was a major roadblock > for kexec efforts, I believe.) I think getting this right will be the > really challenging part. > >> The major open questions for me are the following: >> >> * Is there/has there been significant work in this direction? >> >> * Is there perhaps a better strategy? >> >> * Do the codepaths currently exist to allow dump functionality to write >> to a regular file in the case of a voluntary dump, or would this need to >> be added? > > That would have to be added. You could maybe register a file > dumperinfo (as long as you're careful to prevent its use on > panic-during-suspend), but nothing does this yet. > >> * What would be the most sensible default behavior for device >> hibernate/unhibernate methods? >> >> * Any other significant issues > > Undoubtedly something will come up :-). > > Best, > Conrad > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > -- Allan Jude