Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030201AbXBZKwb (ORCPT ); Mon, 26 Feb 2007 05:52:31 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1030205AbXBZKwV (ORCPT ); Mon, 26 Feb 2007 05:52:21 -0500 Received: from ogre.sisk.pl ([217.79.144.158]:59258 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030199AbXBZKwA (ORCPT ); Mon, 26 Feb 2007 05:52:00 -0500 From: "Rafael J. Wysocki" To: LKML Subject: [RFC][PATCH 2/3] Freezer: Take kernel_execve into consideration Date: Mon, 26 Feb 2007 11:49:09 +0100 User-Agent: KMail/1.9.5 Cc: Andrew Morton , Oleg Nesterov , Pavel Machek , Srivatsa Vaddagiri , Aneesh Kumar , "Paul E. McKenney" , Gautham R Shenoy References: <200702261139.59130.rjw@sisk.pl> In-Reply-To: <200702261139.59130.rjw@sisk.pl> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200702261149.10579.rjw@sisk.pl> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1518 Lines: 40 From: Rafael J. Wysocki Kernel threads can become userland processes by calling kernel_execve(). In particular, this may happen right after try_to_freeze_tasks(FREEZER_USER_SPACE) has returned, so try_to_freeze_tasks() needs to take userspace processes into consideration even if it is called with FREEZER_KERNEL_THREADS. Signed-off-by: Rafael J. Wysocki --- kernel/power/process.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Index: linux-2.6.20-mm2/kernel/power/process.c =================================================================== --- linux-2.6.20-mm2.orig/kernel/power/process.c 2007-02-26 08:41:18.000000000 +0100 +++ linux-2.6.20-mm2/kernel/power/process.c 2007-02-26 08:41:57.000000000 +0100 @@ -117,7 +117,7 @@ static unsigned int try_to_freeze_tasks( cancel_freezing(p); continue; } - if (is_user_space(p) == !freeze_user_space) + if (freeze_user_space && !is_user_space(p)) continue; freeze_process(p); @@ -144,7 +144,7 @@ static unsigned int try_to_freeze_tasks( TIMEOUT / HZ, todo); read_lock(&tasklist_lock); do_each_thread(g, p) { - if (is_user_space(p) == !freeze_user_space) + if (freeze_user_space && !is_user_space(p)) continue; task_lock(p); - 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/