mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Andrew Morton <akpm@osdl.org>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/3] Make suspend possible with a traced process at a breakpoint
Date: Thu, 27 Jul 2006 13:16:56 +0200	[thread overview]
Message-ID: <20060727111655.GB1762@elf.ucw.cz> (raw)
In-Reply-To: <200607270941.45876.rjw@sisk.pl>

Hi!

> It should be possible to suspend, either to RAM or to disk, if there's a
> traced process that has just reached a breakpoint.  However, this is a special
> case, because its parent process might have been frozen already and then
> we are unable to deliver the "freeze" signal to the traced process.  If this
> happens, it's better to cancel the freezing of the traced process.

Thanks for debugging this.

> @@ -85,6 +97,10 @@ int freeze_processes(void)
>  				continue;
>  			if (frozen(p))
>  				continue;
> +			if (p->state == TASK_TRACED && frozen(p->parent)) {
> +				cancel_freezing(p);
> +				continue;
> +			}

Could we just add line to freezeable, like this?

...no, this is probably racy, because freezeable() should not change
while we are thawing other processes... I was hoping for one-liner...

diff --git a/kernel/power/process.c b/kernel/power/process.c
index b2a5f67..13dceb8 100644
--- a/kernel/power/process.c
+++ b/kernel/power/process.c
@@ -26,6 +26,7 @@ static inline int freezeable(struct task
 	    (p->flags & PF_NOFREEZE) ||
 	    (p->exit_state == EXIT_ZOMBIE) ||
 	    (p->exit_state == EXIT_DEAD) ||
+	    ((p->exit_state == TASK_TRACED) && frozen(p->parent)) ||
 	    (p->state == TASK_STOPPED))
 		return 0;
 	return 1;

...okay, so ACK on your patch.
								Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  reply	other threads:[~2006-07-27 11:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-27  7:14 [PATCH 0/3] swsusp-related fixes Rafael J. Wysocki
2006-07-27  7:41 ` [PATCH 2/3] Make suspend possible with a traced process at a breakpoint Rafael J. Wysocki
2006-07-27 11:16   ` Pavel Machek [this message]
2006-07-27  7:46 ` [PATCH 3/3] Allow cifsd to suspend if connection is lost Rafael J. Wysocki
2006-07-27 11:10   ` Pavel Machek
2006-07-27  7:52 ` [PATCH 1/3] Disable CPU hotplug during suspend 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=20060727111655.GB1762@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@sisk.pl \
    /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

all inboxes | Powered by JetHome®