[ 13/23] [Suspend2] Add support for thawing just kernel threads or all threads.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Modify the thaw_processes routine so that it takes and implements a
parameter saying whether to thaw all processes, or just kernel space.

Signed-off-by: Nigel Cunningham <[email protected]>

 kernel/power/process.c |   25 +++++++++++++++++++------
 1 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/kernel/power/process.c b/kernel/power/process.c
index a3aca9a..dffe645 100644
--- a/kernel/power/process.c
+++ b/kernel/power/process.c
@@ -182,13 +182,26 @@ static int freeze_process(struct notifie
 	return 0;
 }
 
-void thaw_processes(void)
+void thaw_processes(int do_all_threads)
 {
-	freezer_message("Restarting tasks..");
-	complete_all(&thaw);
-	while (atomic_read(&nr_frozen) > 0)
-		schedule();
-	freezer_message("done\n");
+	if (do_all_threads) {
+		clear_freezer_state(FREEZER_ON);
+		clear_freezer_state(ABORT_FREEZING);
+	}
+
+	complete_all(&kernelspace_thaw);
+	while (atomic_read(&nr_kernelspace_frozen) > 0)
+		yield();
+
+	init_completion(&kernelspace_thaw);
+	freezer_make_fses_rw();
+
+	if (do_all_threads) {
+		complete_all(&userspace_thaw);
+		while (atomic_read(&nr_userspace_frozen) > 0)
+			yield();
+		init_completion(&userspace_thaw);
+	}
 }
 
 static inline void freeze(struct task_struct *p)

--
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]
  Powered by Linux