Re: [PATCH/RFC] Add support to resume swsusp from initrd

From: Pavel Machek
Date: Sun Dec 05 2004 - 16:14:05 EST


Hi!

> These two patches do two things:
>
> 1) The first removes __init declarations from swsusp code
> 2) The second allows for the resume device to be set from userspace (ie,
> without having to use name_to_dev_t) and also allows for resumes to be
> triggered from userspace.
>
> A /sys/power/resume file is added. Doing
>
> echo -n "set 03:02" >/sys/power/resume

I'd prefer not to have this one. Is it actually usefull? Then resume
could be triggered by echo -n "03:02" > /sys/power/resume...

> will set /dev/hda2 as the resume device.
>
> echo -n "resume 03:02" >/sys/power/resume
>
> will attempt a resume from /dev/hda2. Patches are against
> 2.6.10-rc3.

Nice way to loose your data :-). [Note note note -- I'm not going to
merge it before my bigdiff goes to mainline, so expect to rediff it
when 2.6.10 is out. I can generate the big diff if you want to test it
now.]

You really need to make sure that userland processes are stopped
before swsusp-resume is started. You should do freeze_process(). Then
resume process depends on having enough memory available, so you
probably want to free_some_memory() and warn in documentation about
the fact.

Ugh, and you really should document "list of bad ideas with resume
from userspace". It is extremely easy to shoot yourself into the foot
with this one.
Pavel
--
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/