Lines Matching refs:tsk

211 void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times)  in thread_group_cputimer()  argument
213 struct thread_group_cputimer *cputimer = &tsk->signal->cputimer; in thread_group_cputimer()
224 thread_group_cputime(tsk, &sum); in thread_group_cputimer()
264 static int posix_cpu_clock_get_task(struct task_struct *tsk, in posix_cpu_clock_get_task() argument
272 if (same_thread_group(tsk, current)) in posix_cpu_clock_get_task()
273 err = cpu_clock_sample(which_clock, tsk, &rtn); in posix_cpu_clock_get_task()
275 if (tsk == current || thread_group_leader(tsk)) in posix_cpu_clock_get_task()
276 err = cpu_clock_sample_group(which_clock, tsk, &rtn); in posix_cpu_clock_get_task()
426 void posix_cpu_timers_exit(struct task_struct *tsk) in posix_cpu_timers_exit() argument
428 add_device_randomness((const void*) &tsk->se.sum_exec_runtime, in posix_cpu_timers_exit()
430 cleanup_timers(tsk->cpu_timers); in posix_cpu_timers_exit()
433 void posix_cpu_timers_exit_group(struct task_struct *tsk) in posix_cpu_timers_exit_group() argument
435 cleanup_timers(tsk->signal->cpu_timers); in posix_cpu_timers_exit_group()
580 bool posix_cpu_timers_can_stop_tick(struct task_struct *tsk) in posix_cpu_timers_can_stop_tick() argument
582 if (!task_cputime_zero(&tsk->cputime_expires)) in posix_cpu_timers_can_stop_tick()
585 if (tsk->signal->cputimer.running) in posix_cpu_timers_can_stop_tick()
834 static void check_thread_timers(struct task_struct *tsk, in check_thread_timers() argument
837 struct list_head *timers = tsk->cpu_timers; in check_thread_timers()
838 struct signal_struct *const sig = tsk->signal; in check_thread_timers()
839 struct task_cputime *tsk_expires = &tsk->cputime_expires; in check_thread_timers()
843 expires = check_timers_list(timers, firing, prof_ticks(tsk)); in check_thread_timers()
846 expires = check_timers_list(++timers, firing, virt_ticks(tsk)); in check_thread_timers()
850 tsk->se.sum_exec_runtime); in check_thread_timers()
861 tsk->rt.timeout > DIV_ROUND_UP(hard, USEC_PER_SEC/HZ)) { in check_thread_timers()
866 __group_send_sig_info(SIGKILL, SEND_SIG_PRIV, tsk); in check_thread_timers()
869 if (tsk->rt.timeout > DIV_ROUND_UP(soft, USEC_PER_SEC/HZ)) { in check_thread_timers()
879 tsk->comm, task_pid_nr(tsk)); in check_thread_timers()
880 __group_send_sig_info(SIGXCPU, SEND_SIG_PRIV, tsk); in check_thread_timers()
897 static void check_cpu_itimer(struct task_struct *tsk, struct cpu_itimer *it, in check_cpu_itimer() argument
918 tsk->signal->leader_pid, cur_time); in check_cpu_itimer()
919 __group_send_sig_info(signo, SEND_SIG_PRIV, tsk); in check_cpu_itimer()
932 static void check_process_timers(struct task_struct *tsk, in check_process_timers() argument
935 struct signal_struct *const sig = tsk->signal; in check_process_timers()
945 thread_group_cputimer(tsk, &cputime); in check_process_timers()
957 check_cpu_itimer(tsk, &sig->it[CPUCLOCK_PROF], &prof_expires, ptime, in check_process_timers()
959 check_cpu_itimer(tsk, &sig->it[CPUCLOCK_VIRT], &virt_expires, utime, in check_process_timers()
972 __group_send_sig_info(SIGKILL, SEND_SIG_PRIV, tsk); in check_process_timers()
979 __group_send_sig_info(SIGXCPU, SEND_SIG_PRIV, tsk); in check_process_timers()
1095 static inline int fastpath_timer_check(struct task_struct *tsk) in fastpath_timer_check() argument
1100 task_cputime(tsk, &utime, &stime); in fastpath_timer_check()
1102 if (!task_cputime_zero(&tsk->cputime_expires)) { in fastpath_timer_check()
1106 .sum_exec_runtime = tsk->se.sum_exec_runtime in fastpath_timer_check()
1109 if (task_cputime_expired(&task_sample, &tsk->cputime_expires)) in fastpath_timer_check()
1113 sig = tsk->signal; in fastpath_timer_check()
1133 void run_posix_cpu_timers(struct task_struct *tsk) in run_posix_cpu_timers() argument
1145 if (!fastpath_timer_check(tsk)) in run_posix_cpu_timers()
1148 if (!lock_task_sighand(tsk, &flags)) in run_posix_cpu_timers()
1155 check_thread_timers(tsk, &firing); in run_posix_cpu_timers()
1160 if (tsk->signal->cputimer.running) in run_posix_cpu_timers()
1161 check_process_timers(tsk, &firing); in run_posix_cpu_timers()
1171 unlock_task_sighand(tsk, &flags); in run_posix_cpu_timers()
1201 void set_process_cpu_timer(struct task_struct *tsk, unsigned int clock_idx, in set_process_cpu_timer() argument
1207 cpu_timer_sample_group(clock_idx, tsk, &now); in set_process_cpu_timer()
1235 if (expires_gt(tsk->signal->cputime_expires.prof_exp, *newval)) in set_process_cpu_timer()
1236 tsk->signal->cputime_expires.prof_exp = *newval; in set_process_cpu_timer()
1239 if (expires_gt(tsk->signal->cputime_expires.virt_exp, *newval)) in set_process_cpu_timer()
1240 tsk->signal->cputime_expires.virt_exp = *newval; in set_process_cpu_timer()