lkml.org 
[lkml]   [2006]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[Suspend2][ 15/20] [Suspend2] Attempt to freeze processes.
Date
Call the freezer code to get processes frozen, and abort suspending if that
fails. May be called multiple times as we thaw kernel space (only) if we
need to free memory to meet constraints.

Signed-off-by: Nigel Cunningham <nigel@suspend2.net>

kernel/power/prepare_image.c | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/kernel/power/prepare_image.c b/kernel/power/prepare_image.c
index a23722d..12d715a 100644
--- a/kernel/power/prepare_image.c
+++ b/kernel/power/prepare_image.c
@@ -491,3 +491,26 @@ static int update_image(void)
(header_storage_needed() + main_storage_needed(1, 1)));
}

+/* attempt_to_freeze
+ *
+ * Try to freeze processes.
+ */
+
+static int attempt_to_freeze(void)
+{
+ int result;
+
+ /* Stop processes before checking again */
+ thaw_processes(FREEZER_ALL_THREADS);
+ suspend_prepare_status(CLEAR_BAR, "Freezing processes");
+ result = freeze_processes();
+
+ if (result) {
+ set_result_state(SUSPEND_ABORTED);
+ set_result_state(SUSPEND_FREEZING_FAILED);
+ } else
+ are_frozen = 1;
+
+ return result;
+}
+
--
Nigel Cunningham nigel at suspend2 dot net
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-06-27 01:27    [W:0.101 / U:0.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site