Lines Matching refs:tsk

230 void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times)  in thread_group_cputimer()  argument
232 struct thread_group_cputimer *cputimer = &tsk->signal->cputimer; in thread_group_cputimer()
242 thread_group_cputime(tsk, &sum); in thread_group_cputimer()
287 static int posix_cpu_clock_get_task(struct task_struct *tsk, in posix_cpu_clock_get_task() argument
295 if (same_thread_group(tsk, current)) in posix_cpu_clock_get_task()
296 err = cpu_clock_sample(which_clock, tsk, &rtn); in posix_cpu_clock_get_task()
298 if (tsk == current || thread_group_leader(tsk)) in posix_cpu_clock_get_task()
299 err = cpu_clock_sample_group(which_clock, tsk, &rtn); in posix_cpu_clock_get_task()
449 void posix_cpu_timers_exit(struct task_struct *tsk) in posix_cpu_timers_exit() argument
451 add_device_randomness((const void*) &tsk->se.sum_exec_runtime, in posix_cpu_timers_exit()
453 cleanup_timers(tsk->cpu_timers); in posix_cpu_timers_exit()
456 void posix_cpu_timers_exit_group(struct task_struct *tsk) in posix_cpu_timers_exit_group() argument
458 cleanup_timers(tsk->signal->cpu_timers); in posix_cpu_timers_exit_group()
603 bool posix_cpu_timers_can_stop_tick(struct task_struct *tsk) in posix_cpu_timers_can_stop_tick() argument
605 if (!task_cputime_zero(&tsk->cputime_expires)) in posix_cpu_timers_can_stop_tick()
609 if (READ_ONCE(tsk->signal->cputimer.running)) in posix_cpu_timers_can_stop_tick()
858 static void check_thread_timers(struct task_struct *tsk, in check_thread_timers() argument
861 struct list_head *timers = tsk->cpu_timers; in check_thread_timers()
862 struct signal_struct *const sig = tsk->signal; in check_thread_timers()
863 struct task_cputime *tsk_expires = &tsk->cputime_expires; in check_thread_timers()
871 if (task_cputime_zero(&tsk->cputime_expires)) in check_thread_timers()
874 expires = check_timers_list(timers, firing, prof_ticks(tsk)); in check_thread_timers()
877 expires = check_timers_list(++timers, firing, virt_ticks(tsk)); in check_thread_timers()
881 tsk->se.sum_exec_runtime); in check_thread_timers()
892 tsk->rt.timeout > DIV_ROUND_UP(hard, USEC_PER_SEC/HZ)) { in check_thread_timers()
897 __group_send_sig_info(SIGKILL, SEND_SIG_PRIV, tsk); in check_thread_timers()
900 if (tsk->rt.timeout > DIV_ROUND_UP(soft, USEC_PER_SEC/HZ)) { in check_thread_timers()
910 tsk->comm, task_pid_nr(tsk)); in check_thread_timers()
911 __group_send_sig_info(SIGXCPU, SEND_SIG_PRIV, tsk); in check_thread_timers()
926 static void check_cpu_itimer(struct task_struct *tsk, struct cpu_itimer *it, in check_cpu_itimer() argument
947 tsk->signal->leader_pid, cur_time); in check_cpu_itimer()
948 __group_send_sig_info(signo, SEND_SIG_PRIV, tsk); in check_cpu_itimer()
961 static void check_process_timers(struct task_struct *tsk, in check_process_timers() argument
964 struct signal_struct *const sig = tsk->signal; in check_process_timers()
975 if (!READ_ONCE(tsk->signal->cputimer.running)) in check_process_timers()
987 thread_group_cputimer(tsk, &cputime); in check_process_timers()
999 check_cpu_itimer(tsk, &sig->it[CPUCLOCK_PROF], &prof_expires, ptime, in check_process_timers()
1001 check_cpu_itimer(tsk, &sig->it[CPUCLOCK_VIRT], &virt_expires, utime, in check_process_timers()
1014 __group_send_sig_info(SIGKILL, SEND_SIG_PRIV, tsk); in check_process_timers()
1021 __group_send_sig_info(SIGXCPU, SEND_SIG_PRIV, tsk); in check_process_timers()
1139 static inline int fastpath_timer_check(struct task_struct *tsk) in fastpath_timer_check() argument
1143 if (!task_cputime_zero(&tsk->cputime_expires)) { in fastpath_timer_check()
1146 task_cputime(tsk, &task_sample.utime, &task_sample.stime); in fastpath_timer_check()
1147 task_sample.sum_exec_runtime = tsk->se.sum_exec_runtime; in fastpath_timer_check()
1148 if (task_cputime_expired(&task_sample, &tsk->cputime_expires)) in fastpath_timer_check()
1152 sig = tsk->signal; in fastpath_timer_check()
1185 void run_posix_cpu_timers(struct task_struct *tsk) in run_posix_cpu_timers() argument
1197 if (!fastpath_timer_check(tsk)) in run_posix_cpu_timers()
1200 if (!lock_task_sighand(tsk, &flags)) in run_posix_cpu_timers()
1207 check_thread_timers(tsk, &firing); in run_posix_cpu_timers()
1209 check_process_timers(tsk, &firing); in run_posix_cpu_timers()
1219 unlock_task_sighand(tsk, &flags); in run_posix_cpu_timers()
1249 void set_process_cpu_timer(struct task_struct *tsk, unsigned int clock_idx, in set_process_cpu_timer() argument
1255 cpu_timer_sample_group(clock_idx, tsk, &now); in set_process_cpu_timer()
1283 if (expires_gt(tsk->signal->cputime_expires.prof_exp, *newval)) in set_process_cpu_timer()
1284 tsk->signal->cputime_expires.prof_exp = *newval; in set_process_cpu_timer()
1287 if (expires_gt(tsk->signal->cputime_expires.virt_exp, *newval)) in set_process_cpu_timer()
1288 tsk->signal->cputime_expires.virt_exp = *newval; in set_process_cpu_timer()