• Home
  • Raw
  • Download

Lines Matching refs:task

73 	struct task_struct *g, *task;  in klp_complete_transition()  local
110 for_each_process_thread(g, task) { in klp_complete_transition()
111 WARN_ON_ONCE(test_tsk_thread_flag(task, TIF_PATCH_PENDING)); in klp_complete_transition()
112 task->patch_state = KLP_UNDEFINED; in klp_complete_transition()
117 task = idle_task(cpu); in klp_complete_transition()
118 WARN_ON_ONCE(test_tsk_thread_flag(task, TIF_PATCH_PENDING)); in klp_complete_transition()
119 task->patch_state = KLP_UNDEFINED; in klp_complete_transition()
163 void klp_update_patch_state(struct task_struct *task) in klp_update_patch_state() argument
183 if (test_and_clear_tsk_thread_flag(task, TIF_PATCH_PENDING)) in klp_update_patch_state()
184 task->patch_state = READ_ONCE(klp_target_state); in klp_update_patch_state()
242 static int klp_check_stack(struct task_struct *task, char *err_buf) in klp_check_stack() argument
249 ret = stack_trace_save_tsk_reliable(task, entries, ARRAY_SIZE(entries)); in klp_check_stack()
253 __func__, task->comm, task->pid); in klp_check_stack()
266 __func__, task->comm, task->pid, in klp_check_stack()
281 static bool klp_try_switch_task(struct task_struct *task) in klp_try_switch_task() argument
292 if (task->patch_state == klp_target_state) in klp_try_switch_task()
307 rq = task_rq_lock(task, &flags); in klp_try_switch_task()
309 if (task_running(rq, task) && task != current) { in klp_try_switch_task()
311 "%s: %s:%d is running\n", __func__, task->comm, in klp_try_switch_task()
312 task->pid); in klp_try_switch_task()
316 ret = klp_check_stack(task, err_buf); in klp_try_switch_task()
322 clear_tsk_thread_flag(task, TIF_PATCH_PENDING); in klp_try_switch_task()
323 task->patch_state = klp_target_state; in klp_try_switch_task()
326 task_rq_unlock(rq, task, &flags); in klp_try_switch_task()
345 struct task_struct *g, *task; in klp_send_signals() local
351 for_each_process_thread(g, task) { in klp_send_signals()
352 if (!klp_patch_pending(task)) in klp_send_signals()
361 if (task->flags & PF_KTHREAD) { in klp_send_signals()
366 wake_up_state(task, TASK_INTERRUPTIBLE); in klp_send_signals()
372 spin_lock_irq(&task->sighand->siglock); in klp_send_signals()
373 signal_wake_up(task, 0); in klp_send_signals()
374 spin_unlock_irq(&task->sighand->siglock); in klp_send_signals()
391 struct task_struct *g, *task; in klp_try_complete_transition() local
407 for_each_process_thread(g, task) in klp_try_complete_transition()
408 if (!klp_try_switch_task(task)) in klp_try_complete_transition()
417 task = idle_task(cpu); in klp_try_complete_transition()
419 if (!klp_try_switch_task(task)) in klp_try_complete_transition()
421 } else if (task->patch_state != klp_target_state) { in klp_try_complete_transition()
423 clear_tsk_thread_flag(task, TIF_PATCH_PENDING); in klp_try_complete_transition()
424 task->patch_state = klp_target_state; in klp_try_complete_transition()
465 struct task_struct *g, *task; in klp_start_transition() local
480 for_each_process_thread(g, task) in klp_start_transition()
481 if (task->patch_state != klp_target_state) in klp_start_transition()
482 set_tsk_thread_flag(task, TIF_PATCH_PENDING); in klp_start_transition()
491 task = idle_task(cpu); in klp_start_transition()
492 if (task->patch_state != klp_target_state) in klp_start_transition()
493 set_tsk_thread_flag(task, TIF_PATCH_PENDING); in klp_start_transition()
506 struct task_struct *g, *task; in klp_init_transition() local
530 for_each_process_thread(g, task) { in klp_init_transition()
531 WARN_ON_ONCE(task->patch_state != KLP_UNDEFINED); in klp_init_transition()
532 task->patch_state = initial_state; in klp_init_transition()
540 task = idle_task(cpu); in klp_init_transition()
541 WARN_ON_ONCE(task->patch_state != KLP_UNDEFINED); in klp_init_transition()
542 task->patch_state = initial_state; in klp_init_transition()
581 struct task_struct *g, *task; in klp_reverse_transition() local
598 for_each_process_thread(g, task) in klp_reverse_transition()
599 clear_tsk_thread_flag(task, TIF_PATCH_PENDING); in klp_reverse_transition()
645 struct task_struct *g, *task; in klp_force_transition() local
651 for_each_process_thread(g, task) in klp_force_transition()
652 klp_update_patch_state(task); in klp_force_transition()