[RFC/RFT] finally solve "swsusp fails with mysqld" problem

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

 



Place refrigerator hook at more clever place; avoids "system can't be
suspended while mysqld running" problem.

I'd like you to test it. It looks correct to me, and it is actually a
solution, not a workaround like my previous tries. It still does not
solve suspend while running stress tests.

Signed-off-by: Pavel Machek <[email protected]>

---
commit 01d049aacf36961d361cfd382fcbf746afcbb61b
tree 67e3d1fcb65cebfab058f9a699534b1689494dad
parent 92dfb5b4ac96e200138006901837056825c758d3
author <[email protected]> Tue, 31 Jan 2006 10:18:22 +0100
committer <[email protected]> Tue, 31 Jan 2006 10:18:22 +0100

 arch/i386/kernel/signal.c |    3 ---
 fs/jbd/journal.c          |    1 +
 kernel/signal.c           |    4 ++--
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/arch/i386/kernel/signal.c b/arch/i386/kernel/signal.c
index adcd069..5ad8c65 100644
--- a/arch/i386/kernel/signal.c
+++ b/arch/i386/kernel/signal.c
@@ -615,9 +615,6 @@ int fastcall do_signal(struct pt_regs *r
 	if (!user_mode(regs))
 		return 1;
 
-	if (try_to_freeze())
-		goto no_signal;
-
 	if (!oldset)
 		oldset = &current->blocked;
 
diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c
index e4b516a..20b5918 100644
--- a/fs/jbd/journal.c
+++ b/fs/jbd/journal.c
@@ -153,6 +153,7 @@ loop:
 	}
 
 	wake_up(&journal->j_wait_done_commit);
+	/* Race here? May someone already be waking at *next* commit? */
 	if (freezing(current)) {
 		/*
 		 * The simpler the better. Flushing journal isn't a
diff --git a/kernel/signal.c b/kernel/signal.c
index 717f1f3..6ef3c90 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -1922,6 +1922,8 @@ int get_signal_to_deliver(siginfo_t *inf
 	sigset_t *mask = &current->blocked;
 	int signr = 0;
 
+	try_to_freeze();
+
 relock:
 	spin_lock_irq(&current->sighand->siglock);
 	for (;;) {
@@ -2307,7 +2309,6 @@ sys_rt_sigtimedwait(const sigset_t __use
 
 			timeout = schedule_timeout_interruptible(timeout);
 
-			try_to_freeze();
 			spin_lock_irq(&current->sighand->siglock);
 			sig = dequeue_signal(current, &these, &info);
 			current->blocked = current->real_blocked;

diff --git a/arch/x86_64/kernel/signal.c b/arch/x86_64/kernel/signal.c
index 5876df1..f4dd2ca 100644
--- a/arch/x86_64/kernel/signal.c
+++ b/arch/x86_64/kernel/signal.c
@@ -443,9 +443,6 @@ int do_signal(struct pt_regs *regs, sigs
 	if (!user_mode(regs))
 		return 1;
 
-	if (try_to_freeze())
-		goto no_signal;
-
 	if (!oldset)
 		oldset = &current->blocked;
 

-- 
Thanks, Sharp!
-
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