public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stefan Seyfried <seife@suse.de>
To: ncunningham@cyclades.com
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	mgarrett@chiark.greenend.org.uk
Subject: Re: Suspend-to-disk woes
Date: Mon, 21 Mar 2005 10:33:51 +0100	[thread overview]
Message-ID: <423E94FF.9000603@suse.de> (raw)
In-Reply-To: <1111384766.9720.144.camel@desktop.cunningham.myip.net.au>

Hi,

Nigel Cunningham wrote:

> On Mon, 2005-03-21 at 11:17, Matthew Garrett wrote:

>> It's trivial to do this in userspace - just have an app in initramfs

> It's not that trivial.

> - Your image might not be stored in a swap partition. For Suspend2, it
> can potentially in a swap file or (soon) an ordinary file;
> - Finding which partition to look in for the signature might be non
> trivial (labels in fstab). You'd want to hard code it or (perferably)
> copy a config file from the root (or other) partition;
> - Having addressed the above issues, you still need to add code to read
> the swap header, parse it to find the header, read the header from the
> image, parse it and obtain the kernel version of the saved image.

Well, and you want to compile all this into the kernel? Just to hold the
hands of users who have not read the fine manual?
And you'd need to compile this into all kernels, especially those that
_don't_ support suspend to disk. Or you are back at the place where the
thread started.

> If your image is not stored in a swap partition, you probably can't
> mount the fs the image is stored on, because doing so will replay the
> image and make resuming unsafe, so this approach is less trivial without
> knowing exactly which disk blocks and device IDs to use (and using dd to
> access them).

GRUB reads kernel and initramfs from a dirty reiserfs partition on
resume (although this is a bad idea if you want a fast resume, but
that's another problem). It is possible.

> On top of these, we have two implementations, so you'll want to check
> for the signatures of both.

This is the final argument for doing it in userspace :-).

> That said, I am considering making something like what you're saying:
> exposing methods of testing whether an image exists and an entry through
> which you can get Suspend to erase an image via a proc (eventually
> sysfs) entry. This will allow something like what you're saying to be
> controlled from userspace.

It does not help if the next kernel i boot is not suspend2 patched. This
work should rather go into a library that exports this functions to
userspace programs, for all known suspend implementations.

Regards,

   Stefan


  reply	other threads:[~2005-03-21 13:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-18 16:28 Suspend-to-disk woes Erik Andrén
2005-03-18 17:54 ` Stefan Seyfried
2005-03-18 22:04 ` Nigel Cunningham
2005-03-19 13:26 ` Pavel Machek
2005-03-19 20:20   ` Russell Miller
2005-03-19 21:29     ` Pavel Machek
2005-03-19 21:44       ` Russell Miller
2005-03-21  0:14       ` Nigel Cunningham
2005-03-21  0:17         ` Matthew Garrett
2005-03-21  5:59           ` Nigel Cunningham
2005-03-21  9:33             ` Stefan Seyfried [this message]
2005-03-21 21:38               ` Nigel Cunningham
2005-03-21  7:38         ` Stefan Seyfried
2005-03-21 11:23           ` Nigel Cunningham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=423E94FF.9000603@suse.de \
    --to=seife@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgarrett@chiark.greenend.org.uk \
    --cc=ncunningham@cyclades.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox