linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Patrick Mochel <mochel@osdl.org>
Cc: Nigel Cunningham <ncunningham@clear.net.nz>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: SWSUSP Discontiguous pagedir patch
Date: Mon, 10 Mar 2003 20:23:00 +0100	[thread overview]
Message-ID: <20030310192300.GC11310@atrey.karlin.mff.cuni.cz> (raw)
In-Reply-To: <Pine.LNX.4.33.0303101012230.1002-100000@localhost.localdomain>

Hi!

> > But your solution would also only support *one* suspend partition,
> > right? (And patches for using more than one swap partition are
> > available for 2.4.X; I don't like them due to added complexity).
> 
> Having a dedicated partition has an advantage in just that - it's 
> dedicated to saving system state. Users must consciously create it, and 
> must make it as big as the size of memory they have (or will have). Plus, 
> it's not tied to the amount of memory being used when you suspend. 

That's a problem. Users do not have suspend partitions, but they do
have swap partition. And repartitioning existing installation is very
painfull. OTOH it is true that if we want
"emergency-suspend-to-disk-when-battery-low", dedicated partition
makes some sense.... ... Well. You can always do swapoff, swapon,
swsusp. Maybe some processes will die, but that's life ;-).

[But for that you'd have to guarantee that suspend always works, which
is hard, anyway.] 

> Swap space has a specific purpose, I see it as a detriment to overload its 
> intended usage. Of couse, that's just my opinion, and I don't have code to 
> back it up. 

Well, I see it as advantage because I have swap space anyway (rarely
really used), so why not reuse it for swsusp?

> > It is pretty magical operation, so you are at least warned. [And this has
> > nothing to do with fact we suspend-to-swap].
> 
> IMO, warnings should be conveyed in comments, not in cryptic function 
> names. Besides, there is nothing magical about it, unless that sequence of 
> instructions actually does make your computer glow, levitate, or turn into 
> a mermaid. In which case, I would like to know where I can find one. ;)

:-). Well, comments were getting out of date because code was in
permanent flux. It makes sense to comment it now.

> > Your solution will not work if your suspend partition is not there.
> 
> I didn't mean to sound like a hypocrit, I apologize. The advantage of 
> using a dedicated partition over swap is that in order to create the 
> partition, the user must make a conscious decision to do so. 
> 
> There are parameters that can be enforced when making the partition, like 
> the size and its existence on a persistant medium. These can be enforced 
> by a user making a swap partition, but it places extra burden on the user. 

Well, IMO checklist like:

if you want to use swsusp you have to 

a) check swap is on persistent medium

b) make sure swap is at least as big as memory/2 [not really
neccessary, we might be lucky and swsusp with 30MB of swap...]

is easier for the user than repartitioning their harddrives. [I'd like
to see someone running swap on floppy ;-)]

> > So you don't really want to create separate "suspend partition"? Good.
> 
> Sorry, the patch included a few distinct things, and I should have made it
> a bit more clear. In includes:
> 
> - A generic PM framework which PM drivers can register with. 
> 
> Users can specificy which handler they wish to use for different states, 
> based on their preference or the capabilities of their systems. 
> 
> They can also use one mechanism for entering power states: 
> /sys/power/power_state, instead of relying different mechanisms for 
> different PM drivers (/proc/acpi/sleep vs. apm(1)
> vs. sys_reboot()). 

I believe sys_reboot() is the right way to do
that. /sys/power/... needs sysfs mounted etc. /proc/acpi/sleep just
happened to already be there and be very convenient.

> In the long run, I'd like to develop a solution using a dedicated 
> partition. But, that wouldn't necessarily obviate the use of swsusp. It 
> would coexist alongside it. 

Actually "dedicated partition" vs. "swap partition" is quite a small
detail. It only affects disk allocation routines. Basic stuff like
"atomic copy" stays the same...

> > > I understand you may not a rewrite of swsusp (regardless of how much
> > > cleaner the code is), and I respect that. I'm completely willing to leave
> > > kernel/suspend.c intact, and let you work in the integration into the
> > > generic PM model, and/or simply rename the new code something like
> > > swsusp2, swsusp-XP, or swsusp-pat. ;)
> > 
> > So you want to develop swsusp-pat that will suspend to partition,
> > allow another kernel version, and you think you can suspend when 90%
> > of your memory is kmalloc()-ed? Do you agree that separate disk
> > drivers for suspend is bad idea?
> 
> Yes.

Do you think you can suspend with 90% memory kmalloc()-ed?

							Pavel
-- 
Horseback riding is like software...
...vgf orggre jura vgf serr.

  reply	other threads:[~2003-03-10 19:12 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1045784829.3821.10.camel@laptop-linux.cunninghams>
     [not found] ` <20030223223757.GA120@elf.ucw.cz>
     [not found]   ` <1046136752.1784.15.camel@laptop-linux.cunninghams>
     [not found]     ` <20030227132024.GB27084@atrey.karlin.mff.cuni.cz>
2003-02-27 18:42       ` SWSUSP Discontiguous pagedirs Nigel Cunningham
2003-03-01  4:22       ` SWSUSP Discontiguous pagedir patch Nigel Cunningham
2003-03-02 23:55         ` Patrick Mochel
2003-03-03  2:06           ` Nigel Cunningham
2003-03-03  2:31           ` Nigel Cunningham
2003-03-03 12:30           ` Pavel Machek
2003-03-04 20:36             ` Patrick Mochel
2003-03-05 20:50               ` Pavel Machek
2003-03-05 21:52                 ` Linux vs Windows temperature anomaly Jonathan Lundell
2003-03-05 23:11                   ` Herman Oosthuysen
2003-03-05 23:38                     ` Con Kolivas
2003-03-05 23:50                       ` Russell King
2003-03-06  0:29                         ` Ed Sweetman
2003-03-06  0:47                           ` Trever L. Adams
2003-03-06  9:45                             ` Russell King
2003-03-06  1:58                           ` Jonathan Lundell
2003-03-06  7:18                       ` Corvus Corax
2003-03-06  7:57                         ` Ed Sweetman
2003-03-06  8:18                           ` Corvus Corax
2003-03-06  8:58                             ` Ed Sweetman
2003-03-06 15:41                               ` Jesse Pollard
2003-03-06 14:27                         ` Jesse Pollard
2003-03-06  2:57                   ` David Rees
2003-03-06  6:12                   ` Matthias Schniedermeyer
2003-03-06 16:07                     ` Jonathan Lundell
2003-03-07  0:40                   ` Horst von Brand
2003-03-05 18:02           ` SWSUSP Discontiguous pagedir patch Pavel Machek
2003-03-07 17:14             ` Patrick Mochel
2003-03-07 20:27               ` Pavel Machek
2003-03-09 19:39                 ` Benjamin Herrenschmidt
2003-03-09 20:12                   ` Pavel Machek
2003-03-10 16:49                 ` Patrick Mochel
2003-03-10 19:23                   ` Pavel Machek [this message]
2003-03-10 19:05                     ` Patrick Mochel
2003-03-10 22:17                     ` Nigel Cunningham
2003-03-10 23:20                       ` Pavel Machek
2003-03-07 20:36               ` Pavel Machek
2003-03-10 16:51                 ` Patrick Mochel
2003-03-10 19:12                   ` Pavel Machek
2003-03-10 18:59                     ` Patrick Mochel
2003-03-07 20:41               ` Pavel Machek

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=20030310192300.GC11310@atrey.karlin.mff.cuni.cz \
    --to=pavel@ucw.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochel@osdl.org \
    --cc=ncunningham@clear.net.nz \
    /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;
as well as URLs for NNTP newsgroup(s).