mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@suse.cz>
To: Nigel Cunningham <ncunningham@cyclades.com>
Cc: Andy Isaacson <adi@hexapodia.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"Rafael J. Wysocki" <rjw@sisk.pl>
Subject: Re: swsusp performance problems in 2.6.15-rc3-mm1
Date: Tue, 6 Dec 2005 02:52:00 +0100	[thread overview]
Message-ID: <20051206015200.GJ1770@elf.ucw.cz> (raw)
In-Reply-To: <1133832410.6360.35.camel@localhost>

Hi!

> > > > If goal is "make it work with least effort", answer is of course
> > > > suspend2; but I need someone to help me doing it right.
> > > 
> > > How do you think suspend2 does it wrong? Is it just that you think that
> > > everything belongs in userspace, or is there more to it?
> > 
> > Everything belongs in userspace... that makes it "wrong
> > enough". Userland and kernel programming is quite different, so any
> > improvements to suspend2 will be wasted, long-term. You'll make users
> > happy for now, but it means u-swsusp gets less users and less
> > developers, making "doing it right" slightly harder...
> 
> Ok. I guess I need help then in seeing why everything belongs in
> userspace. Actually, let's revise that for a start - I know you don't
> really mean everything, because even you still do the atomic copy in
> kernel space... or are you planning on changing that too? :)

Unfortunately atomic copy can not be moved to userspace, nor can be
driver handling moved. [If I knew how to do it completely from
userspace, I definitely would, BTW.]

> I'm not unwilling to be convinced - I just don't see why, with such a
> lowlevel operation as suspending to disk, userspace is the place to put
> everything. The preference for userspace seems to me to be just that - a
> preference.

Its actually pretty hard rule. It should be userspace if it reasonably
can. It should be userspace if it contains policy.

suspend2 contains bits of policy -- esc to cancel, compression
options, encryption options. It is not unreasonable that someone would
want any key to cancel, or some other compression, or something like
that. You actually put progressbar code into userspace -- good
step. So you have all the complexity of userspace running during
suspend/resume (it is not that bad), but are not using full benefits
-- move more code to userspace. 

Practical benefits of u-swsusp should be:

* no need to split userland parts in small pieces.

* it is easier to develop in userspace.

* access to libraries -- adding LZW or whatever is not a problem. No
need to convert those libraries to kernel coding style.

* it is possible to have multiple version. In kernel, only one version
can exist, but in userland, it is okay to have few implementations.

> Regarding improvements to suspend2 being wasted long term, I actually
> think that I could port at least part of it to userspace without too
> much effort at all. My main concern would be exporting the information
> and interfaces needed in a way that isn't ugly, is reliable and doesn't
> open security holes. I'm not at all convinced that kmem meets those
> criteria. But if you can show me a better way, I'll happily come on
> board.

I have thought about this. We already mark pages for suspend with
PageNosave | PageNosaveFree; we could only allow access to pages
marked like this by /dev/suspend, or something like that. 

Rafael thinks we should provide nicer interface to userspace; that's
okay with me as long as it is not slow or too much of code.

								Pavel
-- 
Thanks, Sharp!

  reply	other threads:[~2005-12-06  1:52 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-05  8:19 Andy Isaacson
2005-12-05 12:17 ` Pavel Machek
2005-12-05 13:58   ` Nigel Cunningham
2005-12-05 17:29     ` Pavel Machek
2005-12-05 21:11       ` Nigel Cunningham
2005-12-05 23:34         ` Pavel Machek
2005-12-06  1:26           ` Nigel Cunningham
2005-12-06  1:52             ` Pavel Machek [this message]
2005-12-05 22:44       ` Rafael J. Wysocki
2005-12-06  0:01         ` Pavel Machek
2005-12-05 22:28     ` Rafael J. Wysocki
2005-12-06  1:07       ` Nigel Cunningham
2005-12-06  1:37         ` Pavel Machek
2005-12-06  1:47           ` Andy Isaacson
2005-12-06  1:56             ` IDE performance on notebooks [was Re: swsusp performance problems in 2.6.15-rc3-mm1] Pavel Machek
2005-12-06  6:23               ` Andy Isaacson
2005-12-06 11:56                 ` Pavel Machek
2005-12-06  1:57             ` swsusp performance problems in 2.6.15-rc3-mm1 Nigel Cunningham
2005-12-06  3:50             ` Mark Lord
2005-12-06 15:03               ` Mark Lord
2005-12-06  2:02           ` Nigel Cunningham
2005-12-06 12:09             ` Pavel Machek
2005-12-06  1:36       ` Nigel Cunningham
2005-12-06  2:06         ` Andy Isaacson
2005-12-06  2:21           ` Nigel Cunningham
2005-12-06 14:22             ` Pavel Machek
2005-12-07 22:05               ` Nigel Cunningham
2005-12-07 22:23                 ` Pavel Machek
2005-12-06  2:21           ` Nigel Cunningham
2005-12-06 12:18           ` Pavel Machek
2005-12-06 18:15             ` Andy Isaacson
2005-12-07  1:05               ` Rafael J. Wysocki
2005-12-07  1:10                 ` Pavel Machek
2005-12-07 11:17                   ` Rafael J. Wysocki
2005-12-07 11:30                     ` Pavel Machek
2005-12-08 22:42                       ` Rafael J. Wysocki
2005-12-08 22:50                         ` Pavel Machek
2005-12-05 21:18   ` Rafael J. Wysocki
2005-12-05 23:55     ` swsusp: how much memory to free? [was Re: swsusp performance problems in 2.6.15-rc3-mm1] Pavel Machek
2005-12-07 11:53       ` Rafael J. Wysocki
2005-12-07 11:59         ` Pavel Machek
2005-12-07 12:16           ` Rafael J. Wysocki
2005-12-07 12:18             ` Pavel Machek
2005-12-05 23:05 ` swsusp performance problems in 2.6.15-rc3-mm1 Rafael J. Wysocki
2005-12-06  0:12   ` Andy Isaacson
2005-12-06  0:51     ` Pavel Machek
2005-12-10 22:21   ` Andrew Morton
2005-12-10 23:07     ` Rafael J. Wysocki
2005-12-10 23:33       ` Andrew Morton
2005-12-11 12:16         ` Rafael J. Wysocki
2005-12-11 23:28           ` Pavel Machek
2005-12-12 17:45             ` Rafael J. Wysocki

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=20051206015200.GJ1770@elf.ucw.cz \
    --to=pavel@suse.cz \
    --cc=adi@hexapodia.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ncunningham@cyclades.com \
    --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

Powered by JetHome