lkml.org 
[lkml]   [2015]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: Fwd: [RFC] make kthread_worker_fn to be freezable
From
2015-06-01 19:40 GMT+08:00 Tejun Heo <tj@kernel.org>:
> Hello,
>
> On Mon, Jun 01, 2015 at 06:05:58PM +0800, yalin wang wrote:
>> 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>
>
> Whether a kthread worker should be able to freeze or not is to be
> determined by the owner of the specific kthread. If the kthread is
> marked freezable, kthread_worker will freeze. If not, it won't.
>
this means i need create kthread like this :

struct task_struct *kworker_task = kthread_run(kthread_worker_fn,
&worker, "nvme%d", dev->instance);
kworker_task->flags &= ~PF_NOFREEZE;
is it safe to do like this ?

i don't see an API to set other thread to be freezable .
only set_freezable() , which set the current thread to be freezable .

am i missing something ?
Thanks


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