From: Pavel Machek <pavel@ucw.cz>
To: kernel list <linux-kernel@vger.kernel.org>,
Patrick Mochel <mochel@osdl.org>
Subject: [PM] suspend.c cleanups
Date: Sun, 27 Jul 2003 00:58:10 +0200 [thread overview]
Message-ID: <20030726225809.GA528@elf.ucw.cz> (raw)
Hi!
These are only cleanups.
Pavel
Index: linux/kernel/suspend.c
===================================================================
--- linux.orig/kernel/suspend.c 2003-07-22 13:39:43.000000000 +0200
+++ linux/kernel/suspend.c 2003-07-22 13:46:26.000000000 +0200
@@ -139,40 +139,45 @@
static const char name_suspend[] = "Suspend Machine: ";
static const char name_resume[] = "Resume Machine: ";
#endif
/*
* Debug
*/
-#define DEBUG_DEFAULT
-#undef DEBUG_PROCESS
+#undef DEBUG_DEFAULT
#undef DEBUG_SLOW
-#define TEST_SWSUSP 0 /* Set to 1 to reboot instead of halt machine after suspension */
+#define TEST_SWSUSP 1 /* Set to 1 to reboot instead of halt machine after suspension */
#ifdef DEBUG_DEFAULT
-# define PRINTK(f, a...) printk(f, ## a)
+# define PRINTK(f, a...) printk(f, ## a)
#else
-# define PRINTK(f, a...)
+# define PRINTK(f, a...) do {} while (0)
#endif
#ifdef DEBUG_SLOW
#define MDELAY(a) mdelay(a)
#else
-#define MDELAY(a)
+#define MDELAY(a) do {} while (0)
#endif
@@ -283,17 +329,6 @@
return 0;
}
-/*
- * This is our sync function. With this solution we probably won't sleep
- * but that should not be a problem since tasks are stopped..
- */
-
-static inline void do_suspend_sync(void)
-{
- blk_run_queues();
-#warning This might be broken. We need to somehow wait for data to reach the disk
-}
-
/* We memorize in swapfile_used what swap devices are used for suspension */
#define SWAPFILE_UNUSED 0
#define SWAPFILE_SUSPEND 1 /* This is the suspending device */
@@ -861,20 +861,13 @@
if (prepare_suspend_console())
printk( "%sCan't allocate a console... proceeding\n", name_suspend);
if (!prepare_suspend_processes()) {
-
/* At this point, all user processes and "dangerous"
kernel threads are stopped. Free some memory, as we
need half of memory free. */
-
free_some_memory();
- /* No need to invalidate any vfsmnt list -- they will be valid after resume, anyway.
- *
- * We sync here -- so you have consistent filesystem state when things go wrong.
- * -- so that noone writes to disk after we do atomic copy of data.
- */
- PRINTK("Syncing disks before copy\n");
- do_suspend_sync();
+ /* No need to invalidate any vfsmnt list -- they will be valid after resume, anyway. */
+ blk_run_queues();
/* Save state of all device drivers, and stop them. */
if(drivers_suspend()==0)
@@ -906,7 +898,7 @@
return;
software_suspend_enabled = 0;
- BUG_ON(in_interrupt());
+ BUG_ON(in_atomic());
do_software_suspend();
}
--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
next reply other threads:[~2003-07-26 22:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-26 22:58 Pavel Machek [this message]
2003-08-05 1:00 ` [PM] suspend.c cleanups Patrick Mochel
2003-08-05 9:15 ` 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=20030726225809.GA528@elf.ucw.cz \
--to=pavel@ucw.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=mochel@osdl.org \
/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