From owner-freebsd-hackers@freebsd.org Tue Aug 23 05:14:07 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 9BFDCBC3982 for ; Tue, 23 Aug 2016 05:14:07 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 7C29B1B3E for ; Tue, 23 Aug 2016 05:14:07 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 7B794BC3981; Tue, 23 Aug 2016 05:14:07 +0000 (UTC) Delivered-To: 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 7B19DBC3980 for ; Tue, 23 Aug 2016 05:14:07 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f43.google.com (mail-it0-f43.google.com [209.85.214.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F18D1B3D for ; Tue, 23 Aug 2016 05:14:07 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f43.google.com with SMTP id n128so117510431ith.1 for ; Mon, 22 Aug 2016 22:14:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=g3DlaS77J5/qhvh7Usm5op6N3Fy2rZMXDN+7hejU4RQ=; b=e5y73l0cm33P/EyVaWwZoSAInFnJPX4Rc41rf+GLbZlEZBjrUFUKd5j3CPMLqhxNPU I5UN4ZFUB9SKL9SRs6mJzyiTKYbeeo0gr0XNGFXG5XjERRujYzFOUcYf80c8qEVlg0fY NVKcuFNfyvWrivB+k/yRwjg80eEpdmTDE33dsMdFOU0JQx38CBem+KTqu+Zpf5+pB42z 1ZDm7giP/9KUs5pEGYz7TcZytTnxou8fSCFwrP8Egt6Qj04Tu0OahoElCwBsCQvBuuSM 31BDb7uqVKwTo8IxdGgEEPLly1xUubuCFFY11L4fx5RX+SETTyYB+h3OIv7WmV3XH5gQ CGCw== X-Gm-Message-State: AEkooutxPk3xGhdOjMbBZiuzSGjw2HK8MqX8KN0SKBd9x1sauIUKX4Dc1fAH6XWOOEQ3Ow== X-Received: by 10.107.22.198 with SMTP id 189mr32223414iow.0.1471929245885; Mon, 22 Aug 2016 22:14:05 -0700 (PDT) Received: from mail-it0-f53.google.com (mail-it0-f53.google.com. [209.85.214.53]) by smtp.gmail.com with ESMTPSA id j16sm844225iod.25.2016.08.22.22.14.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Aug 2016 22:14:05 -0700 (PDT) Received: by mail-it0-f53.google.com with SMTP id e63so127936996ith.1 for ; Mon, 22 Aug 2016 22:14:05 -0700 (PDT) X-Received: by 10.107.28.11 with SMTP id c11mr32285463ioc.7.1471929245497; Mon, 22 Aug 2016 22:14:05 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.36.220.129 with HTTP; Mon, 22 Aug 2016 22:14:05 -0700 (PDT) In-Reply-To: <141b1050-8fb5-e8c7-0e0f-50607f2f28b9@metricspace.net> References: <141b1050-8fb5-e8c7-0e0f-50607f2f28b9@metricspace.net> From: Conrad Meyer Date: Mon, 22 Aug 2016 22:14:05 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Info about suspend-to-disk To: Eric McCorkle Cc: hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 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:14:07 -0000 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.) > * 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