Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751538AbZKHEXU (ORCPT ); Sat, 7 Nov 2009 23:23:20 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751341AbZKHEXT (ORCPT ); Sat, 7 Nov 2009 23:23:19 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:43119 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751301AbZKHEXS convert rfc822-to-8bit (ORCPT ); Sat, 7 Nov 2009 23:23:18 -0500 From: "Dasgupta, Romit" To: Pavel Machek CC: "Rafael J. Wysocki" , "linux-omap@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-pm@lists.linux-foundation.org" Date: Sun, 8 Nov 2009 09:52:52 +0530 Subject: RE: [PATCH 1/1] PM: Thaws refrigerated and to be exited kernel threads Thread-Topic: [PATCH 1/1] PM: Thaws refrigerated and to be exited kernel threads Thread-Index: AcpfyvyiT7SeWBXYSl+BeKH48JB+cAAX2SRg Message-ID: References: <20091107165421.GA1630@ucw.cz> In-Reply-To: <20091107165421.GA1630@ucw.cz> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1611 Lines: 41 > Subject: Re: [PATCH 1/1] PM: Thaws refrigerated and to be exited kernel > threads > > Hi! > > > Kicks out a frozen thread from the refrigerator when an active thread has > > invoked kthread_stop on the frozen thread. > > > > Signed-off-by: Romit Dasgupta > > --- > > > > diff --git a/kernel/freezer.c b/kernel/freezer.c > > index bd1d42b..c28dbe8 100644 > > --- a/kernel/freezer.c > > +++ b/kernel/freezer.c > > @@ -9,6 +9,7 @@ > > #include > > #include > > #include > > +#include > > > > /* > > * freezing is complete, mark current process as frozen > > @@ -49,7 +50,7 @@ void refrigerator(void) > > > > for (;;) { > > set_current_state(TASK_UNINTERRUPTIBLE); > > - if (!frozen(current)) > > + if (!frozen(current) || (!current->mm && kthread_should_stop())) > > break; > > schedule(); > > Well, what if the thread does some processing before stopping? That > would break refrigerator assumptions... The suspend thread will block until the 'to be stopped' thread clears up. That is what any call to kthread_stop would boil down to. The target thread would anyway be out of the refrigerator so I am not sure what assumption you mean here. Eventually, the target thread would clear up and wake up the suspend thread and then things would go on as usual. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/