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 <[email protected]>
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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]