From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2992754AbXCBXeK (ORCPT ); Fri, 2 Mar 2007 18:34:10 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S2992753AbXCBXeK (ORCPT ); Fri, 2 Mar 2007 18:34:10 -0500 Received: from mail.screens.ru ([213.234.233.54]:54321 "EHLO mail.screens.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2992752AbXCBXeJ (ORCPT ); Fri, 2 Mar 2007 18:34:09 -0500 Date: Sat, 3 Mar 2007 02:33:37 +0300 From: Oleg Nesterov To: "Paul E. McKenney" Cc: "Rafael J. Wysocki" , Anton Blanchard , Andrew Morton , Pavel Machek , LKML , Aneesh Kumar , Srivatsa Vaddagiri , Gautham R Shenoy Subject: Re: [PATCH -mm 3/7] Freezer: Remove PF_NOFREEZE from rcutorture thread Message-ID: <20070302233337.GA267@tv-sign.ru> References: <200702260800.49603.rjw@sisk.pl> <200703011609.43804.rjw@sisk.pl> <20070301193826.GA14587@kryten> <200703012054.26940.rjw@sisk.pl> <20070302213549.GC2373@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070302213549.GC2373@linux.vnet.ibm.com> User-Agent: Mutt/1.5.11 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On 03/02, Paul E. McKenney wrote: > > One way to embed try_to_freeze() into kthread_should_stop() might be > as follows: > > int kthread_should_stop(void) > { > if (kthread_stop_info.k == current) > return 1; > try_to_freeze(); > return 0; > } I think this is dangerous. For example, worker_thread() will probably need some special actions after return from refrigerator. Also, a kernel thread may check kthread_should_stop() in the place where try_to_freeze() is not safe. Perhaps we should introduce a new helper which does this. Oleg.