On Fri, Dec 16, 2005 at 11:16:23AM +0100, Stefan Seyfried wrote: > This is almost trivially solvable from userspace (not tested, beware :-): > - check the return code of your write() to /sys/power/state > - if it is ENOMEM (better look into the kernel code if this is what is > actually reported...), then write "0" to image_size and try again. > > or (not as sophisticated, and i am not sure if the paths are all correct): > ---- > #!/bin/sh > echo 150 > /sys/power/image_size > echo disk > /sys/power/state > if [ $? -ne 0 ]; then > echo 0 > /sys/power/image_size > echo disk > /sys/power/state > fi > ---- > this will retry on any error (e.g. process not stopped, no swap space > at all, device refused to suspend...) not only on ENOMEM, but echo > unfortunately does not return the error code, only success or failure. > Easy solution would be a small perl or C program. > > I am not convinced that this should be handled in the kernel. I do not see a horrific logical problem here, given that the maximum desired image size is the minimum of max_image_size and free swap space available. The main question is the one of implementation, though. Yours, Chris
Attachment:
pgpDCF5gTgyVr.pgp
Description: PGP signature
- Follow-Ups:
- Re: [RFC/RFT] swsusp: image size tunable (was: Re: [PATCH][mm] swsusp: limit image size)
- From: "Rafael J. Wysocki" <[email protected]>
- Re: [RFC/RFT] swsusp: image size tunable (was: Re: [PATCH][mm] swsusp: limit image size)
- References:
- [PATCH][mm] swsusp: limit image size
- From: "Rafael J. Wysocki" <[email protected]>
- Re: [RFC/RFT] swsusp: image size tunable (was: Re: [PATCH][mm] swsusp: limit image size)
- From: Pavel Machek <[email protected]>
- Re: [RFC/RFT] swsusp: image size tunable (was: Re: [PATCH][mm] swsusp: limit image size)
- From: "Rafael J. Wysocki" <[email protected]>
- Re: [RFC/RFT] swsusp: image size tunable (was: Re: [PATCH][mm] swsusp: limit image size)
- From: "Rafael J. Wysocki" <[email protected]>
- Re: [RFC/RFT] swsusp: image size tunable (was: Re: [PATCH][mm] swsusp: limit image size)
- From: Andy Isaacson <[email protected]>
- Re: [RFC/RFT] swsusp: image size tunable (was: Re: [PATCH][mm] swsusp: limit image size)
- From: Stefan Seyfried <[email protected]>
- [PATCH][mm] swsusp: limit image size
- Prev by Date: driver loading during boot
- Next by Date: [PATCH 1/2] build dasd_cmd into dasd_mod
- Previous by thread: Re: [RFC/RFT] swsusp: image size tunable (was: Re: [PATCH][mm] swsusp: limit image size)
- Next by thread: Re: [RFC/RFT] swsusp: image size tunable (was: Re: [PATCH][mm] swsusp: limit image size)
- Index(es):