mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kyle Moffett <mrmacman_g4@mac.com>
To: Phillip Susi <psusi@cfl.rr.com>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	Alon Bar-Lev <alon.barlev@gmail.com>,
	Kernel development list <linux-kernel@vger.kernel.org>
Subject: Re: Flames over -- Re: Which is simpler?
Date: Sun, 12 Feb 2006 21:25:55 -0500	[thread overview]
Message-ID: <FEF719AC-F269-49AF-8820-74FDE1A1F4F9@mac.com> (raw)
In-Reply-To: <43EFD806.3000904@cfl.rr.com>

On Feb 12, 2006, at 19:51, Phillip Susi wrote:
> Alan Stern wrote:
>> Both of you are missing an important difference between Suspend-to- 
>> RAM and Suspend-to-Disk. Suspend-to-RAM is a true suspend  
>> operation, in that the hardware's state is maintained _in the  
>> hardware_.  External buses like USB will retain suspend power, for  
>> instance (assuming the motherboard supports it; some don't).
>> Suspend-to-Disk, by contrast, is _not_ a true suspend.  It can  
>> more accurately be described as checkpoint-and-turn-off.  Hardware  
>> state is not maintained.  (Some systems may support a special ACPI  
>> state that does maintain suspend power to external buses during  
>> shutdown, I forget what it's called.  And I down't know whether  
>> swsusp uses this state.)
>
> I would disagree.  The only difference between the two is WHERE the  
> state is maintained - ram vs. disk.  I won't really argue it  
> though, because it's just semantics -- call it whatever you want.

 From the simple perspective, yes, that's the only difference.  On  
the other hand, from an efficiency standpoint, they are _completely_  
different, to a degree that the OS needs to treat them as such or  
performance will suck.  Software suspend (to disk, network, file,  
etc) _requires_ a copy; it's completely mandatory because RAM is  
guaranteed to go away.  It freezes everything, checkpoints the kernel  
with a lot of really complex and oft-buggy code, unfreezes things,  
stores data, and shuts off.  Hardware suspend (to RAM only)  
implicitly needs no copy.  The CPU and memory architecture itself  
supports the low-power state, so you don't have to do much of  
anything special about kernel or userspace threads, you just have to  
suspend the device tree once (already exists for per-device power  
management) and then tell the firmware to finish up.  The former is O 
(memory), the latter is O(1).

For a significant majority of people, hardware suspend is  
significantly better.  I never understood why people need graphical  
splash screens during suspend/resume... until I tried software- 
suspend.  With hardware-suspend, I close it, 2 seconds later the  
little white light on the front comes on and it's sleeping, I open  
it, 2 seconds later it's connected to wireless again and ready to  
use.  With software-suspend, it just _doesn't_ work that fast because  
of the inherent way it does things; hard disks on laptops are _slow_.

>> So for example, let's say you have a filesystem mounted on a USB  
>> flash or disk drive.  With Suspend-to-RAM, there's a very good  
>> chance that the connection and filesystem will still be intact  
>> when you resume.  With  Suspend-to-Disk, the USB connection will  
>> terminate when the computer shuts down.  When you resume, the  
>> device will be gone and your filesystem will be screwed.
>
> This is not true.  The USB bus is shut down either way, and  
> provided that you have not unplugged the disk, nothing will be  
> screwed when you resume from disk or ram.

It depends on the hardware.  For the disk case, yes, this is true.   
On the other hand, for hardware-suspend a number of devices like  
keyboards and mice may still be in a low-power suspend mode, allowing  
you to wake the computer by pushing keys or mouse buttons.

Cheers,
Kyle Moffett

--
There are two ways of constructing a software design. One way is to  
make it so simple that there are obviously no deficiencies. And the  
other way is to make it so complicated that there are no obvious  
deficiencies.  The first method is far more difficult.
   -- C.A.R. Hoare



  parent reply	other threads:[~2006-02-13  2:26 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-12 16:57 Alan Stern
2006-02-13  0:51 ` Phillip Susi
2006-02-13  2:19   ` Alan Stern
2006-02-13  3:52     ` Phillip Susi
2006-02-13  5:43       ` Kyle Moffett
2006-02-13 16:40         ` Phillip Susi
2006-02-13 16:31       ` Alan Stern
2006-02-13 17:14         ` Phillip Susi
2006-02-13 20:04           ` Alan Stern
2006-02-13 20:38             ` Phillip Susi
2006-02-13 21:24               ` Alan Stern
2006-02-13 22:27                 ` Rafael J. Wysocki
2006-02-14 19:26                   ` Alan Stern
2006-02-14 20:41                     ` Rafael J. Wysocki
2006-02-14 21:08                       ` Lee Revell
2006-02-15 15:56                       ` Alan Stern
2006-02-13 22:51                 ` J. Bruce Fields
2006-02-13 23:47                 ` Phillip Susi
2006-02-14  0:50                   ` Kyle Moffett
2006-02-14  2:09                     ` Phillip Susi
2006-02-14  4:09                       ` Kyle Moffett
2006-02-14  4:28                         ` Alan Stern
2006-02-14  5:11                           ` Kyle Moffett
2006-02-14 15:33                             ` Alan Stern
2006-02-14  6:27                         ` Phillip Susi
2006-02-14 16:23                           ` Kyle Moffett
2006-02-14 18:39                             ` Phillip Susi
2006-02-14 19:55                               ` Kyle Moffett
2006-02-14 21:13                                 ` Phillip Susi
2006-02-14 23:32                                   ` Kyle Moffett
2006-02-15  3:08                                     ` Phillip Susi
2006-02-14 19:14                             ` Olivier Galibert
2006-02-14 19:37                               ` Phillip Susi
2006-02-17 21:04                   ` Pavel Machek
2006-02-18 16:34                     ` Phillip Susi
2006-02-18 17:29                       ` Pavel Machek
2006-02-19  5:52                         ` Phillip Susi
2006-02-19  9:02                           ` Pavel Machek
2006-02-19 16:35                             ` Phillip Susi
2006-02-19 16:41                               ` Alan Stern
2006-02-19 19:17                                 ` Phillip Susi
2006-02-19 19:43                                   ` Pavel Machek
2006-02-20  0:56                                     ` Olivier Galibert
2006-02-20  1:01                                       ` Pavel Machek
2006-02-20  1:26                                         ` Olivier Galibert
2006-02-20  4:04                                           ` Alan Stern
2006-02-19 20:16                                   ` Bernd Eckenfels
2006-02-18 21:04                     ` Alan Stern
2006-02-19  0:02                       ` Andrew Morton
2006-02-19  6:02                         ` Phillip Susi
2006-02-19  6:32                           ` Andrew Morton
2006-02-19 16:39                             ` Phillip Susi
2006-02-19 16:54                               ` Alan Stern
2006-02-19 20:02                                 ` Andrew Morton
2006-02-19 20:44                                   ` Oliver Neukum
2006-02-19 21:02                                     ` Andrew Morton
2006-02-20  6:55                                       ` Oliver Neukum
2006-02-20  7:29                                         ` Andrew Morton
2006-02-20  7:57                                           ` Andrew Morton
2006-02-14 14:15     ` hackmiester / Hunter Fuller
2006-02-15 23:51     ` Pavel Machek
2006-02-13  2:25   ` Kyle Moffett [this message]
2006-02-13 19:16 David Brownell
2006-02-13 20:08 ` Phillip Susi
2006-02-14  3:10   ` David Brownell
2006-02-14  6:05     ` Phillip Susi
2006-02-14 17:04       ` David Brownell
2006-02-15 23:43   ` Pavel Machek
2006-02-18 20:51     ` David Brownell
2006-02-19  6:06       ` Phillip Susi
2006-02-20  5:50         ` David Brownell
2006-02-20 16:07           ` Phillip Susi
2006-02-20 16:51             ` Olivier Galibert
2006-02-20 18:20               ` Phillip Susi
2006-02-20 18:44                 ` Olivier Galibert
2006-02-20 21:45                   ` Phillip Susi
2006-02-21 16:19             ` David Brownell
2006-02-21 18:30               ` Phillip Susi

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=FEF719AC-F269-49AF-8820-74FDE1A1F4F9@mac.com \
    --to=mrmacman_g4@mac.com \
    --cc=alon.barlev@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=psusi@cfl.rr.com \
    --cc=stern@rowland.harvard.edu \
    /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

all inboxes | Powered by JetHome®