On Mon, Sep 11, 2006 at 04:05:05PM +0200, Rafael J. Wysocki wrote:
> Hi,
> 
> On Monday, 11 September 2006 15:46, Stefan Seyfried wrote:
> > Today i finally managed to set up and test userspace suspend. Everything
> > seems to work somehow (some strange things i need to investigate, e.g.
> > compressed suspend is actually slower than uncompressed).
> 
> Hm, this doesn't reflect my experience. ;-)

I'll investigate. It looks like when uncompressed, my disk light is solid on,
but when compressing, the light is flickering (during writing). Maybe playing
with buffer sizes or something like that might help.
The machine should be fast enough (compaq nx5000, P-M 1.4GHz). Early writeout
gained me 5 seconds, but still compression does not impress me too much, yet.

> > What can we do to fix this? In-kernel suspend calls the apropriate ACPI
> > methods at the beginning and end of suspend IIUC. Can we do something

BTW: in-kernel suspend no longer calls them at the beginning. This definitely
worked better some ~10 kernel versions ago. The moon on the thinkpads no
longer blinks :-)

> > similar from userspace?
> 
> Generally, yes, but we'll need to add an additional ioctl for this purpose.
> I thought we'd have to add it at some point, but I'm not sure what Pavel
> thinks about it.

Something like this? (WARNING: only compile tested, and not even a whole
kernel, only SUBDIRS=kernel/power)

diff -rup /usr/src/linux-2.6.18-rc6-2/kernel/power/power.h 
linux-2.6.18-rc6-2/kernel/power/power.h
--- /usr/src/linux-2.6.18-rc6-2/kernel/power/power.h    2006-09-08 
19:02:33.000000000 +0200
+++ linux-2.6.18-rc6-2/kernel/power/power.h     2006-09-11 19:23:31.000000000 
+0200
@@ -78,7 +78,9 @@ int snapshot_image_loaded(struct snapsho
 #define SNAPSHOT_FREE_SWAP_PAGES       _IO(SNAPSHOT_IOC_MAGIC, 9)
 #define SNAPSHOT_SET_SWAP_FILE         _IOW(SNAPSHOT_IOC_MAGIC, 10, unsigned 
int)
 #define SNAPSHOT_S2RAM                 _IO(SNAPSHOT_IOC_MAGIC, 11)
-#define SNAPSHOT_IOC_MAXNR     11
+#define SNAPSHOT_POWEROFF              _IO(SNAPSHOT_IOC_MAGIC, 12)
+#define SNAPSHOT_POWERUP               _IO(SNAPSHOT_IOC_MAGIC, 13)
+#define SNAPSHOT_IOC_MAXNR     13
 
 /**
  *     The bitmap is used for tracing allocated swap pages
diff -rup /usr/src/linux-2.6.18-rc6-2/kernel/power/user.c 
linux-2.6.18-rc6-2/kernel/power/user.c
--- /usr/src/linux-2.6.18-rc6-2/kernel/power/user.c     2006-06-18 
03:49:35.000000000 +0200
+++ linux-2.6.18-rc6-2/kernel/power/user.c      2006-09-11 19:24:11.000000000 
+0200
@@ -11,6 +11,7 @@
 
 #include <linux/suspend.h>
 #include <linux/syscalls.h>
+#include <linux/reboot.h>
 #include <linux/string.h>
 #include <linux/device.h>
 #include <linux/miscdevice.h>
@@ -302,6 +303,21 @@ OutS3:
                up(&pm_sem);
                break;
 
+       case SNAPSHOT_POWEROFF:
+               if (pm_disk_mode == PM_DISK_PLATFORM) {
+                       kernel_shutdown_prepare(SYSTEM_SUSPEND_DISK);
+                       error = pm_ops->enter(PM_SUSPEND_DISK);
+               } else {
+                       kernel_power_off();
+               }
+               break;
+
+       case SNAPSHOT_POWERUP:
+               if (pm_disk_mode == PM_DISK_PLATFORM) {
+                       if (pm_ops && pm_ops->finish)
+                               pm_ops->finish(PM_SUSPEND_DISK);
+               }
+
        default:
                error = -ENOTTY;
 
-- 
Stefan Seyfried                  \ "I didn't want to write for pay. I
QA / R&D Team Mobile Devices      \ wanted to be paid for what I write."
SUSE LINUX Products GmbH, Nürnberg \                    -- Leonard Cohen

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Suspend-devel mailing list
Suspend-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/suspend-devel

Reply via email to