Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1157079 > unrolled thread

Re: Fwd: [RFC] make kthread_worker_fn to be freezable

Started byTejun Heo <tj@kernel.org>
First post2015-06-03 07:30 +0200
Last post2015-06-03 07:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Fwd: [RFC] make kthread_worker_fn to be freezable Tejun Heo <tj@kernel.org> - 2015-06-03 07:30 +0200

#1157079 — Re: Fwd: [RFC] make kthread_worker_fn to be freezable

FromTejun Heo <tj@kernel.org>
Date2015-06-03 07:30 +0200
SubjectRe: Fwd: [RFC] make kthread_worker_fn to be freezable
Message-ID<px9pw-7O6-5@gated-at.bofh.it>
On Tue, Jun 02, 2015 at 11:13:44AM +0800, yalin wang wrote:
> 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 ?

It's not.

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

But you can create a wrapper kthread function which sets freezable and
calls kthread_worker_fn().

Thanks.

-- 
tejun
--
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/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web