Re: SOFTWARE_SUSPEND as a module

From: Nigel Cunningham
Date: Fri Apr 23 2004 - 08:52:38 EST


On Fri, 23 Apr 2004 19:38:36 +1000, Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> wrote:
What I've done is:

* Split swsusp.c into swsusp-core.c and the rest based on whether it
is called by do_magic() or not.
* Added EXPORTs for the symbols needed by what's left of swsusp.
* Added module parameter parsing.

Do you really need to make suspend a module to achieve this? I'll freely admit it might be nice to save a little bit of memory by modularising it, and it might save Pavel and I a reboot or two while developing, but for what you're after, couldn't you just move the call that starts resuming?

As a side-effect it also allows you to resume from devices that couldn't
be done before due to the need for user-space setup. Examples are LVM
and NBD.

LVM can be compiled in, can't it? Does it need to do some setup from an initrd?

prepared for it in userland? In such case you need to add
freeze_processes() to resume path.

Is that really necessary if the user-space caller ensures that all
disk accesses are shut down? After all the loading for resume will
occur in the initrd before any disk activity has occured.

So long as the initrd doesn't mount any filesystems that were suspended, you should be okay, IIRC.

Nigel Cunningham
C/- Westminster Presbyterian Church Belconnen
61 Templeton Street, Cook, ACT 2614, Australia.
+61 (2) 6251 7727 (wk)
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at