public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: pm list <linux-pm@lists.linux-foundation.org>
Cc: nigel@suspend2.net, Pavel Machek <pavel@ucw.cz>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Matthew Garrett <mjg59@srcf.ucam.org>,
	Oliver Neukum <oliver@neukum.org>,
	Paul Mackerras <paulus@samba.org>,
	Miklos Szeredi <miklos@szeredi.hu>, Ingo Molnar <mingo@elte.hu>
Subject: [RFC][PATCH -mm] PM: Do not sync filesystems from within the freezer
Date: Thu, 5 Jul 2007 22:31:26 +0200	[thread overview]
Message-ID: <200707052231.27780.rjw@sisk.pl> (raw)
In-Reply-To: <200707052137.58164.nigel@nigel.suspend2.net>

From: Rafael J. Wysocki <rjw@sisk.pl>

The syncing of filesystems from within the freezer is generally not needed.
Change freeze_processes() so that it doesn't execute sys_sync() and make the
suspend and hibernation code path sync filesystems independently of the freezer.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
 kernel/power/disk.c    |    4 ++++
 kernel/power/main.c    |    6 ++++++
 kernel/power/process.c |    1 -
 kernel/power/user.c    |    4 ++++
 4 files changed, 14 insertions(+), 1 deletion(-)

Index: linux-2.6.22-rc6-mm1/kernel/power/disk.c
===================================================================
--- linux-2.6.22-rc6-mm1.orig/kernel/power/disk.c
+++ linux-2.6.22-rc6-mm1/kernel/power/disk.c
@@ -297,6 +297,10 @@ int hibernate(void)
 	if (error)
 		goto Exit;
 
+	printk("Syncing filesystems ... ");
+	sys_sync();
+	printk("done.\n");
+
 	error = prepare_processes();
 	if (error)
 		goto Finish;
Index: linux-2.6.22-rc6-mm1/kernel/power/main.c
===================================================================
--- linux-2.6.22-rc6-mm1.orig/kernel/power/main.c
+++ linux-2.6.22-rc6-mm1/kernel/power/main.c
@@ -20,6 +20,7 @@
 #include <linux/resume-trace.h>
 #include <linux/freezer.h>
 #include <linux/vmstat.h>
+#include <linux/syscalls.h>
 
 #include "power.h"
 
@@ -234,9 +235,14 @@ static int enter_state(suspend_state_t s
 
 	if (!valid_state(state))
 		return -ENODEV;
+
 	if (!mutex_trylock(&pm_mutex))
 		return -EBUSY;
 
+	printk("Syncing filesystems ... ");
+	sys_sync();
+	printk("done.\n");
+
 	pr_debug("PM: Preparing system for %s sleep\n", pm_states[state]);
 	if ((error = suspend_prepare()))
 		goto Unlock;
Index: linux-2.6.22-rc6-mm1/kernel/power/process.c
===================================================================
--- linux-2.6.22-rc6-mm1.orig/kernel/power/process.c
+++ linux-2.6.22-rc6-mm1/kernel/power/process.c
@@ -191,7 +191,6 @@ int freeze_processes(void)
 	if (error)
 		return error;
 
-	sys_sync();
 	error = try_to_freeze_tasks(FREEZER_KERNEL_THREADS);
 	if (error)
 		return error;
Index: linux-2.6.22-rc6-mm1/kernel/power/user.c
===================================================================
--- linux-2.6.22-rc6-mm1.orig/kernel/power/user.c
+++ linux-2.6.22-rc6-mm1/kernel/power/user.c
@@ -153,6 +153,10 @@ static int snapshot_ioctl(struct inode *
 		mutex_lock(&pm_mutex);
 		error = pm_notifier_call_chain(PM_HIBERNATION_PREPARE);
 		if (!error) {
+			printk("Syncing filesystems ... ");
+			sys_sync();
+			printk("done.\n");
+
 			error = freeze_processes();
 			if (error)
 				thaw_processes();

  reply	other threads:[~2007-07-05 20:24 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-04 14:58 [RFC][PATCH -mm] PM: Do not sync from within the freezer during suspend to RAM Rafael J. Wysocki
2007-07-04 22:48 ` Nigel Cunningham
2007-07-04 22:49   ` Pavel Machek
2007-07-04 22:52     ` Nigel Cunningham
2007-07-05 11:28       ` Rafael J. Wysocki
2007-07-05 11:37         ` Nigel Cunningham
2007-07-05 20:31           ` Rafael J. Wysocki [this message]
2007-07-05 22:00             ` [RFC][PATCH -mm] PM: Do not sync filesystems from within the freezer Pavel Machek
2007-07-06  7:02               ` Rafael J. Wysocki
2007-07-06  7:07                 ` Nigel Cunningham
2007-07-06  7:13                   ` Miklos Szeredi
2007-07-06  7:19                     ` Nigel Cunningham
2007-07-06  7:36                       ` Miklos Szeredi
2007-07-07 11:48                         ` possible solution for problem 2 (was Re: [RFC][PATCH -mm] PM: Do not sync filesystems from within the freezer) Pavel Machek
2007-07-06  8:59                     ` [RFC][PATCH -mm] PM: Do not sync filesystems from within the freezer Benjamin Herrenschmidt
2007-07-06  9:05                       ` Miklos Szeredi
2007-07-06  9:13                         ` Nigel Cunningham
2007-07-06  9:31                           ` Miklos Szeredi
2007-07-06 10:00                             ` Rafael J. Wysocki

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=200707052231.27780.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=miklos@szeredi.hu \
    --cc=mingo@elte.hu \
    --cc=mjg59@srcf.ucam.org \
    --cc=nigel@suspend2.net \
    --cc=oliver@neukum.org \
    --cc=paulus@samba.org \
    --cc=pavel@ucw.cz \
    /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