Lines Matching refs:k
73 static inline struct kthread *to_kthread(struct task_struct *k) in to_kthread() argument
75 WARN_ON(!(k->flags & PF_KTHREAD)); in to_kthread()
76 return k->worker_private; in to_kthread()
129 void free_kthread_struct(struct task_struct *k) in free_kthread_struct() argument
136 kthread = to_kthread(k); in free_kthread_struct()
143 k->worker_private = NULL; in free_kthread_struct()
161 bool __kthread_should_park(struct task_struct *k) in __kthread_should_park() argument
163 return test_bit(KTHREAD_SHOULD_PARK, &to_kthread(k)->flags); in __kthread_should_park()
598 void kthread_set_per_cpu(struct task_struct *k, int cpu) in kthread_set_per_cpu() argument
600 struct kthread *kthread = to_kthread(k); in kthread_set_per_cpu()
604 WARN_ON_ONCE(!(k->flags & PF_NO_SETAFFINITY)); in kthread_set_per_cpu()
633 void kthread_unpark(struct task_struct *k) in kthread_unpark() argument
635 struct kthread *kthread = to_kthread(k); in kthread_unpark()
642 __kthread_bind(k, kthread->cpu, TASK_PARKED); in kthread_unpark()
648 wake_up_state(k, TASK_PARKED); in kthread_unpark()
664 int kthread_park(struct task_struct *k) in kthread_park() argument
666 struct kthread *kthread = to_kthread(k); in kthread_park()
668 if (WARN_ON(k->flags & PF_EXITING)) in kthread_park()
675 if (k != current) { in kthread_park()
676 wake_up_process(k); in kthread_park()
686 WARN_ON_ONCE(!wait_task_inactive(k, TASK_PARKED)); in kthread_park()
708 int kthread_stop(struct task_struct *k) in kthread_stop() argument
713 trace_sched_kthread_stop(k); in kthread_stop()
715 get_task_struct(k); in kthread_stop()
716 kthread = to_kthread(k); in kthread_stop()
718 kthread_unpark(k); in kthread_stop()
719 set_tsk_thread_flag(k, TIF_NOTIFY_SIGNAL); in kthread_stop()
720 wake_up_process(k); in kthread_stop()
723 put_task_struct(k); in kthread_stop()