lkml.org 
[lkml]   [2015]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
SubjectFwd: [RFC] make kthread_worker_fn to be freezable
From
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 <yalin.wang2010@gmail.com>
---
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

\
 
 \ /
  Last update: 2015-06-01 12:41    [W:0.055 / U:0.564 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site