mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: Linux 2.6.3 doesn't suspend when mysqld is running.
       [not found]     ` <200403141727.03632.jlell@JakobLell.de>
@ 2004-03-21 21:47       ` Pavel Machek
       [not found]         ` <200403231528.32795.jlell@JakobLell.de>
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Machek @ 2004-03-21 21:47 UTC (permalink / raw)
  To: Jakob Lell; +Cc: kernel list

Hi!

> > > even if it might be a problem in mysql, it should not be possible for an
> > > unprivileged process to make the system unable to suspend. Maybe the
> > > kernel should send SIGSTOP to those processes which can't be stopped
> > > otherwise.
> >
> > No, its definitely not problem in mysql.
> >
> > But knowing "where it sleeps in kernel" maybe would make me understand
> > what is going on. And I'm not going to install mysql just to find out.
> 
> Hi,
> now I've examined the code of mysql and it seems to be a problem with signal 
> handling. When a process is calling sigprocmask while suspending, the kernel 
> can't stop it. If you run the code below, the system won't be able to 
> suspend. After the kernel prints an error message that it can't stop the 
> program, it's impossible to terminate it by any signal (even SIGKILL). The 
> only way I've found to terminate the process is to send SIGKILL to it and 
> then suspend the system. After resuming, the process will finally be
> > > killed. 

Can you try this one? (Thanks to Nigel.).

									Pavel

--- tmp/linux/arch/i386/kernel/signal.c	2004-03-11 18:10:38.000000000 +0100
+++ linux/arch/i386/kernel/signal.c	2004-03-21 22:19:23.000000000 +0100
@@ -567,7 +567,8 @@
 
 	if (current->flags & PF_FREEZE) {
 		refrigerator(0);
-		goto no_signal;
+		if (!signal_pending(current))
+			goto no_signal;
 	}
 
 	if (!oldset)

> 
> #include <signal.h>
> #include <errno.h>
> #include <stdlib.h>
> 
> int main(int argc,char ** argv){
>   sigset_t set;
>   int sig;
>   sigemptyset(&set);
>   sigprocmask(SIG_BLOCK,&set,NULL);
>   while(sigwait(&set,&sig)==EINTR);
>   return 0;
> }

-- 
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Linux 2.6.3 doesn't suspend when mysqld is running.
       [not found]         ` <200403231528.32795.jlell@JakobLell.de>
@ 2004-04-19 17:18           ` Pavel Machek
  0 siblings, 0 replies; 2+ messages in thread
From: Pavel Machek @ 2004-04-19 17:18 UTC (permalink / raw)
  To: Jakob Lell, kernel list, Andrew Morton

Hi!

> this patch also didn't fix the problem. You can use the program below to test 
> whether a patch fixes the problem yourself. If you can't suspend while this 
> program is running, then the patch doesn't fix the problem.

Okay, this one should work. Hmm, but I'm not quite sure its the right
fix.

								Pavel

> #include <signal.h>
> #include <errno.h>
> #include <stdlib.h>
> 
> int main(int argc,char ** argv){
>   sigset_t set;
>   int sig;
>   sigemptyset(&set);
>   while(sigwait(&set,&sig)==EINTR);
>   return 0;
> }


--- clean/kernel/signal.c	2004-04-07 22:57:17.000000000 +0200
+++ linux/kernel/signal.c	2004-04-19 19:08:47.000000000 +0200
@@ -2134,6 +2134,8 @@
 		if (timeout)
 			ret = -EINTR;
 	}
+	if (current->flags & PF_FREEZE)
+		refrigerator(1);
 
 	return ret;
 }


-- 
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-04-19 17:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <200402271049.14014.jlell@JakobLell.de>
     [not found] ` <200402282143.36048.jlell@JakobLell.de>
     [not found]   ` <20040228204658.GB10530@elf.ucw.cz>
     [not found]     ` <200403141727.03632.jlell@JakobLell.de>
2004-03-21 21:47       ` Linux 2.6.3 doesn't suspend when mysqld is running Pavel Machek
     [not found]         ` <200403231528.32795.jlell@JakobLell.de>
2004-04-19 17:18           ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®