From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Pavel Machek <pavel@suse.cz>
Cc: LKML <linux-kernel@vger.kernel.org>, Andrew Morton <akpm@osdl.org>
Subject: [PATCH 3/4] swsusp: two simplifications
Date: Mon, 17 Oct 2005 23:58:30 +0200 [thread overview]
Message-ID: <200510172358.31349.rjw@sisk.pl> (raw)
In-Reply-To: <200510172336.53194.rjw@sisk.pl>
The following patch simplifies the progress meter in disk.c:free_some_memory()
and makes disk.c:pm_suspend_disk() call device_resume() explicitly in the
suspend path.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Index: linux-2.6.14-rc4-mm1/kernel/power/disk.c
===================================================================
--- linux-2.6.14-rc4-mm1.orig/kernel/power/disk.c 2005-10-17 23:28:33.000000000 +0200
+++ linux-2.6.14-rc4-mm1/kernel/power/disk.c 2005-10-17 23:28:52.000000000 +0200
@@ -92,10 +92,7 @@
printk("Freeing memory... ");
while ((tmp = shrink_all_memory(10000))) {
pages += tmp;
- printk("\b%c", p[i]);
- i++;
- if (i > 3)
- i = 0;
+ printk("\b%c", p[i++ % 4]);
}
printk("\bdone (%li pages freed)\n", pages);
}
@@ -177,13 +174,12 @@
goto Done;
if (in_suspend) {
+ device_resume();
pr_debug("PM: writing image.\n");
error = swsusp_write();
if (!error)
power_down(pm_disk_mode);
else {
- /* swsusp_write can not fail in device_resume,
- no need to do second device_resume */
swsusp_free();
unprepare_processes();
return error;
Index: linux-2.6.14-rc4-mm1/kernel/power/swsusp.c
===================================================================
--- linux-2.6.14-rc4-mm1.orig/kernel/power/swsusp.c 2005-10-17 23:28:47.000000000 +0200
+++ linux-2.6.14-rc4-mm1/kernel/power/swsusp.c 2005-10-17 23:28:52.000000000 +0200
@@ -562,7 +562,7 @@
int swsusp_write(void)
{
int error;
- device_resume();
+
lock_swapdevices();
error = write_suspend_image();
/* This will unlock ignored swap devices since writing is finished */
next prev parent reply other threads:[~2005-10-17 22:41 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-17 21:36 [PATCH 0/4] swsusp: more cleanups Rafael J. Wysocki
2005-10-17 21:40 ` [PATCH 1/4] swsusp: get rid of unnecessary wrapper function Rafael J. Wysocki
2005-10-17 23:37 ` Pavel Machek
2005-10-17 21:50 ` [PATCH 2/4] swsusp: clean up resume error path Rafael J. Wysocki
2005-10-17 23:47 ` Pavel Machek
2005-10-18 9:17 ` Rafael J. Wysocki
2005-10-21 13:28 ` Pavel Machek
2005-10-17 21:58 ` Rafael J. Wysocki [this message]
2005-10-17 23:54 ` [PATCH 3/4] swsusp: two simplifications Pavel Machek
2005-10-17 22:13 ` [PATCH 4/4] swsusp: reduce the use of global variables Rafael J. Wysocki
2005-10-17 23:56 ` Pavel Machek
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=200510172358.31349.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@suse.cz \
/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®