Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752650AbbFAKGH (ORCPT ); Mon, 1 Jun 2015 06:06:07 -0400 Received: from mail-ie0-f172.google.com ([209.85.223.172]:33552 "EHLO mail-ie0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752153AbbFAKF6 (ORCPT ); Mon, 1 Jun 2015 06:05:58 -0400 MIME-Version: 1.0 In-Reply-To: <64da06e6.12ce6.14dae8b205f.Coremail.cn_wyl2003@126.com> References: <64da06e6.12ce6.14dae8b205f.Coremail.cn_wyl2003@126.com> Date: Mon, 1 Jun 2015 18:05:58 +0800 Message-ID: Subject: Fwd: [RFC] make kthread_worker_fn to be freezable From: yalin wang To: Andrew Morton , laijs@cn.fujitsu.com, tj@kernel.org, nacc@linux.vnet.ibm.com, penguin-kernel@i-love.sakura.ne.jp, Linux Kernel Mailing List Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 953 Lines: 29 I notice that kthread_worker_fn() call try_to_freeze() function, but it don't make itself to be a freezable kthread, kthread default behavior is not freezable, we should change it if want try_to_freeze() work correctly. Signed-off-by: yalin wang --- kernel/kthread.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/kthread.c b/kernel/kthread.c index 10e489c..b20a21d 100644 --- a/kernel/kthread.c +++ b/kernel/kthread.c @@ -550,6 +550,7 @@ int kthread_worker_fn(void *worker_ptr) WARN_ON(worker->task); worker->task = current; + set_freezable(); repeat: set_current_state(TASK_INTERRUPTIBLE); /* mb paired w/ kthread_stop */ -- 1.9.1 -- 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/