public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
To: Pavel Machek <pavel@ucw.cz>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>,
	linux-pm@vger.kernel.org,
	Kyungmin Park <kyungmin.park@samsung.com>
Subject: [RFC PATCH] freezer: allow killing of frozen tasks
Date: Tue, 20 Aug 2013 13:20:03 +0200	[thread overview]
Message-ID: <5917186.DMyAa9ofOj@amdc1032> (raw)

Change __refrigerator() to allow SIGKILL signal handling during
the frozen state (by setting task to a TASK_KILLABLE state instead
of TASK_UNINTERRUPTIBLE one before entering sleep) and make tasks
leave __refrigerator() upon receiving such signal.

These changes allow frozen tasks to be killed immediately without
the need to thaw them first.

Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 kernel/freezer.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel/freezer.c b/kernel/freezer.c
index b462fa1..0c05a7a 100644
--- a/kernel/freezer.c
+++ b/kernel/freezer.c
@@ -57,12 +57,13 @@ bool __refrigerator(bool check_kthr_stop)
 	pr_debug("%s entered refrigerator\n", current->comm);
 
 	for (;;) {
-		set_current_state(TASK_UNINTERRUPTIBLE);
+		set_current_state(TASK_KILLABLE);
 
 		spin_lock_irq(&freezer_lock);
 		current->flags |= PF_FROZEN;
 		if (!freezing(current) ||
-		    (check_kthr_stop && kthread_should_stop()))
+		    (check_kthr_stop && kthread_should_stop()) ||
+		    fatal_signal_pending(current))
 			current->flags &= ~PF_FROZEN;
 		spin_unlock_irq(&freezer_lock);
 
-- 
1.8.2.3



             reply	other threads:[~2013-08-20 11:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-20 11:20 Bartlomiej Zolnierkiewicz [this message]
2013-08-20 12:23 ` [RFC PATCH] freezer: allow killing of frozen tasks Rafael J. Wysocki
2013-08-20 12:18   ` Tejun Heo
2013-08-20 12:30     ` Rafael J. Wysocki
2013-08-20 12:22       ` Tejun Heo
2013-08-20 12:34         ` Rafael J. Wysocki
2013-08-20 12:27           ` Tejun Heo
2013-08-20 12:41             ` Rafael J. Wysocki
2013-09-25  5:52               ` Kyungmin Park
2013-09-25  8:07                 ` Rafael J. Wysocki
2013-09-26  1:46                   ` Colin Cross

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=5917186.DMyAa9ofOj@amdc1032 \
    --to=b.zolnierkie@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --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