public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nigel Cunningham <nigel@suspend2.net>
To: Pavel Machek <pavel@suse.cz>
Cc: Greg KH <greg@kroah.com>, Jens Axboe <axboe@suse.de>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	linux-kernel@vger.kernel.org
Subject: Re: [Suspend2][ 0/9] Extents support.
Date: Thu, 29 Jun 2006 08:25:46 +1000	[thread overview]
Message-ID: <200606290825.50674.nigel@suspend2.net> (raw)
In-Reply-To: <20060628211114.GC13397@elf.ucw.cz>

[-- Attachment #1: Type: text/plain, Size: 4974 bytes --]

Hi.

On Thursday 29 June 2006 07:11, Pavel Machek wrote:
> Hi!
>
> > > > Now I haven't followed the suspend2 vs swsusp debate very closely,
> > > > but it seems to me that your biggest problem with getting this merged
> > > > is getting consensus on where exactly this is going. Nobody wants two
> > > > different suspend modules in the kernel. So there are two options -
> > > > suspend2 is deemed the way to go, and it gets merged and replaces
> > > > swsusp. Or the other way around - people like swsusp more, and you
> > > > are doomed to maintain suspend2 outside the tree.
> > >
> > > Actually, there's a third option that is looking like the way forward,
> > > doing all of this from userspace and having no suspend-to-disk in the
> > > kernel tree at all.
> > >
> > > Pavel and others have a working implementation and are slowly moving
> > > toward adding all of the "bright and shiny" features that is in
> > > suspend2 to it (encryption, progress screens, abort by pressing a key,
> > > etc.) so that there is no loss of functionality.
> > >
> > > So I don't really see the future of suspend2 because of this...
> >
> > But what Rafael and Pavel are doing is really only moving the highest
> > level of controlling logic to userspace (ok, and maybe compression and
> > encryption too). Everything important (freezing other processes, atomic
> > copy and the guts of the I/O) is still done by the kernel.
>
> Can you do the same and move compression/encryption to userspace, too?
>
> And actually that "highest level" covers >50% of suspend2 code. That
> would be around 7K lines of code removed from kernel if you did the
> same, and suspend2 patch would be half the size...

That's not true. The compression and encryption support add ~1000 lines, as 
you pointed out the other day. If I moved compression and encryption support 
to userspace, I'd remove 1000 lines and:

- add more code for getting the pages copied to and from userspace
- require the user to get and build $LIBRARIES for doing the compression
- require the user to get and build $HELPER for doing the interface to 
Suspend2
- fail to leverage the perfectly good cryptoapi routines that are already 
there
- slow the whole process down because I'd now have a copy to userspace for 
every page being compressed/encrypted and a copy from userspace for every 
output page.
- make life more complicated for distro maintainers and users because they'd 
have another set of dependencies to worry about and mess with.

I'm not saying it's impossible. I'm just saying it would make suspending more 
complicated, at least potentially slower and more of a pain for everyone. On 
top of that, imagine if someone comes along and writes their own wizz-bang 
compression module, then complains (without telling you they did it) that 
Suspend2 trashed their hard disk when the bug is actually in their code. It's 
another way in which your kernel can be tainted :)

> > And there _is_ loss of functionality - uswsusp still doesn't support
> > writing a full image of memory, writing to multiple swap devices
> > (partitions or files), or writing to ordinary files. They're getting the
> > low hanging fruit, but when
>
> That's userspace problem. Of course we are after low-hanging fruit,
> first, but uswsusp design (AND CURRENT KERNEL PARTS) allow you to get
> all the fruit with the right userspace.
>
> > it comes to these parts of the problem, they're going to require either
> > smoke and very good mirrors (eg the swap prefetching trick), or simply
> > refuse to implement them.
> >
> :-) I like the mirrors idea. Anyway Rafael *did* get code for saving
>
> whole memory at one point, but it looked quite dangerous to me. It was
> ~300 lines. I'm sure it can be resurrected.
>
> > If we take the problem one step further, and begin to think about
> > checkpointing, they're in even bigger trouble. I'll freely admit that I'd
> > have to redesign the way I store data so that random parts of the image
> > could be replaced, have hooks in mm to be able to learn what pages need
> > have changed and would also need filesystem support to handle that part
> > of the problem, but I'd at least be working in the right domain.
>
> Could you explain? I do not get the checkpointing remark.

Sure. Suspending to disk is a pretty similar problem to checkpointing, except 
that you want to continue running afterwards, keep the image and modify it 
from time to time based on the changes in memory (having a checkpointing 
filesystem too, of course). My point is that modifying uswsusp to do 
checkpointing would be far harder precisely because you've pushed the highest 
level logic to userspace. It would be far more complicated, if not impossible 
for you to make the adjustments to do checkpointing.

Regards,

Nigel

-- 
See http://www.suspend2.net for Howtos, FAQs, mailing
lists, wiki and bugzilla info.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2006-06-28 22:25 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-26 16:54 [Suspend2][ 0/9] Extents support Nigel Cunningham
2006-06-26 16:54 ` [Suspend2][ 1/9] [Suspend2] Extents header Nigel Cunningham
2006-06-26 16:54 ` [Suspend2][ 2/9] [Suspend2] Extent allocation routines Nigel Cunningham
2006-06-26 16:54 ` [Suspend2][ 3/9] [Suspend2] Free a whole extent chain Nigel Cunningham
2006-06-26 16:54 ` [Suspend2][ 4/9] [Suspend2] Add extent to " Nigel Cunningham
2006-06-26 16:54 ` [Suspend2][ 5/9] [Suspend2] Serialise extent chains Nigel Cunningham
2006-06-26 16:54 ` [Suspend2][ 6/9] [Suspend2] Get next extent in an extent state Nigel Cunningham
2006-06-26 16:54 ` [Suspend2][ 7/9] [Suspend2] Extent state to the start Nigel Cunningham
2006-06-26 16:54 ` [Suspend2][ 8/9] [Suspend2] Extent state save and restore Nigel Cunningham
2006-06-26 16:54 ` [Suspend2][ 9/9] [Suspend2] Extent header Nigel Cunningham
2006-06-26 21:20 ` [Suspend2][ 0/9] Extents support Rafael J. Wysocki
2006-06-27  4:28   ` Nigel Cunningham
2006-06-27  5:36     ` Jens Axboe
2006-06-27  5:39       ` Nigel Cunningham
2006-06-27  7:05         ` Jens Axboe
2006-06-27  7:39           ` Nigel Cunningham
2006-06-27  7:59             ` Jens Axboe
2006-06-27  8:12               ` Greg KH
2006-06-27  8:22                 ` Jens Axboe
2006-06-27  8:58                 ` Nigel Cunningham
2006-06-28 21:11                   ` Pavel Machek
2006-06-28 22:25                     ` Nigel Cunningham [this message]
2006-06-28 22:44                       ` Pavel Machek
2006-06-28 23:14                         ` Nigel Cunningham
2006-06-30 17:36                           ` Pavel Machek
2006-06-29  3:11                       ` Martin J. Bligh
2006-06-27  9:07               ` Nigel Cunningham
2006-06-27  9:26                 ` Rafael J. Wysocki
2006-06-27  9:35                   ` Nigel Cunningham
2006-06-27 22:19                     ` Rafael J. Wysocki
2006-06-27 23:47                       ` Nigel Cunningham
2006-06-28 22:35                         ` Rafael J. Wysocki
2006-06-28 23:26                           ` Nigel Cunningham
2006-06-29 20:52                             ` Rafael J. Wysocki
2006-06-30 17:58                           ` Pavel Machek
2006-06-28 11:28             ` Rahul Karnik
2006-06-28 12:42               ` Nigel Cunningham
2006-06-28 14:42                 ` Pekka Enberg
2006-06-28 23:37                   ` Nigel Cunningham
2006-06-29  5:19                     ` Pekka Enberg
2006-06-29  5:44                       ` Nigel Cunningham
2006-06-29 21:11                         ` Rafael J. Wysocki
2006-06-30 17:55                     ` suspend2 merge [was Re: [Suspend2][ 0/9] Extents support.] Pavel Machek
2006-07-01  9:31                       ` Dumitru Ciobarcianu
2006-06-28 22:41                 ` [Suspend2][ 0/9] Extents support Rafael J. Wysocki
2006-06-28 14:37               ` Olivier Galibert
2006-06-28 21:05                 ` Pavel Machek
2006-06-27  7:06         ` Greg KH
2006-06-27  7:27           ` Nigel Cunningham
2006-06-27  7:53             ` Greg KH
2006-06-27  9:08               ` 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=200606290825.50674.nigel@suspend2.net \
    --to=nigel@suspend2.net \
    --cc=axboe@suse.de \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@suse.cz \
    --cc=rjw@sisk.pl \
    /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