Re: function thaw_kernel_threads introduced by new kernel stable patch
Jordi Pujol <[email protected]>
| Newsgroups | gmane.linux.swsusp.devel |
|---|---|
| Message-ID | <[email protected]> |
A Dimarts, 7 de febrer de 2012 12:05:34, Nigel Cunningham va escriure: > Hi Jordi. > > On 07/02/12 21:18, Jordi Pujol wrote: > > Hi all, > > > > the kernel stable patch > > > > pm-hibernate-fix-s2disk-regression-related-to-freezing-workqueues > > > > has introduced another version of the function "thaw_kernel_threads" > > that conflicts with this one from TuxOnIce, > > Here's a patch generated from my git tree. I'm assuming you're using the > 3.2 series. If that's not the case, let me know and I'll do one from > another branch. > Hi Nigel, yes, I use the latest 3.2 and the stable patches, Thank you Nigel for this update, but it does not modify the code for the function "thaw_kernel_threads" that conflicts with the kernel's stable patch, I did the attached modification, which works for me because the computer hibernates and resumes, but I don't know if it is correct, Regards, Jordi Pujol Live never ending Tale GNU/Linux Live forever! http://livenet.selfip.com _______________________________________________ TuxOnIce-devel mailing list [email protected] http://lists.tuxonice.net/listinfo/tuxonice-devel
tuxonice-thaw_kernel_threads-part.diff
(text/x-patch, 1.2 KB)
@@ -211,22 +211,45 @@ static void thaw_tasks(bool nosig_only)
void thaw_processes(void)
{
+ int old_state = freezer_state;
+
+ if (old_state == FREEZER_OFF)
+ return;
+
+ freezer_state = FREEZER_OFF;
+
oom_killer_enable();
- printk("Restarting tasks ... ");
- thaw_workqueues();
- thaw_tasks(true);
+ printk(KERN_INFO "Restarting all filesystems ...\n");
+ thaw_filesystems(FS_FREEZER_ALL);
+
+ printk(KERN_INFO "Restarting tasks ... ");
+ if (old_state == FREEZER_FULLY_ON) {
+ thaw_workqueues();
+ thaw_tasks(true);
+ }
+
thaw_tasks(false);
schedule();
printk("done.\n");
}
+EXPORT_SYMBOL_GPL(thaw_processes);
+
void thaw_kernel_threads(void)
{
- printk("Restarting kernel threads ... ");
+ freezer_state = FREEZER_USERSPACE_FROZEN;
+ printk(KERN_INFO "Restarting normal filesystems.\n");
+ thaw_filesystems(FS_FREEZER_NORMAL);
+ printk(KERN_INFO "Restarting kernel threads ... ");
thaw_workqueues();
thaw_tasks(true);
schedule();
- printk("done.\n");
+ printk(KERN_INFO "done.\n");
}
+/*
+ * It's ugly putting this EXPORT down here, but it's necessary so that it
+ * doesn't matter whether the fs-freezing patch is applied or not.
+ */
+EXPORT_SYMBOL_GPL(thaw_kernel_threads);
diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c