[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFP4FLp1zkS0LT64V=sLKCKEED+76016M3bX05n3RJF=KFS-zA@mail.gmail.com>
Date: Tue, 2 Jun 2015 11:13:44 +0800
From: yalin wang <yalin.wang2010@...il.com>
To: Tejun Heo <tj@...nel.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>, laijs@...fujitsu.com,
nacc@...ux.vnet.ibm.com, penguin-kernel@...ove.sakura.ne.jp,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: Fwd: [RFC] make kthread_worker_fn to be freezable
2015-06-01 19:40 GMT+08:00 Tejun Heo <tj@...nel.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@...il.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists