• Home
  • Raw
  • Download

Lines Matching refs:tsk

144 static void __exit_signal(struct task_struct *tsk)  in __exit_signal()  argument
146 struct signal_struct *sig = tsk->signal; in __exit_signal()
147 bool group_dead = thread_group_leader(tsk); in __exit_signal()
152 sighand = rcu_dereference_check(tsk->sighand, in __exit_signal()
157 posix_cpu_timers_exit(tsk); in __exit_signal()
159 posix_cpu_timers_exit_group(tsk); in __exit_signal()
173 if (tsk == sig->curr_target) in __exit_signal()
174 sig->curr_target = next_thread(tsk); in __exit_signal()
177 add_device_randomness((const void*) &tsk->se.sum_exec_runtime, in __exit_signal()
186 task_cputime(tsk, &utime, &stime); in __exit_signal()
190 sig->gtime += task_gtime(tsk); in __exit_signal()
191 sig->min_flt += tsk->min_flt; in __exit_signal()
192 sig->maj_flt += tsk->maj_flt; in __exit_signal()
193 sig->nvcsw += tsk->nvcsw; in __exit_signal()
194 sig->nivcsw += tsk->nivcsw; in __exit_signal()
195 sig->inblock += task_io_get_inblock(tsk); in __exit_signal()
196 sig->oublock += task_io_get_oublock(tsk); in __exit_signal()
197 task_io_accounting_add(&sig->ioac, &tsk->ioac); in __exit_signal()
198 sig->sum_sched_runtime += tsk->se.sum_exec_runtime; in __exit_signal()
200 __unhash_process(tsk, group_dead); in __exit_signal()
207 flush_sigqueue(&tsk->pending); in __exit_signal()
208 tsk->sighand = NULL; in __exit_signal()
212 clear_tsk_thread_flag(tsk, TIF_SIGPENDING); in __exit_signal()
221 struct task_struct *tsk = container_of(rhp, struct task_struct, rcu); in delayed_put_task_struct() local
223 kprobe_flush_task(tsk); in delayed_put_task_struct()
224 rethook_flush_task(tsk); in delayed_put_task_struct()
225 perf_event_delayed_put(tsk); in delayed_put_task_struct()
226 trace_sched_process_free(tsk); in delayed_put_task_struct()
227 put_task_struct(tsk); in delayed_put_task_struct()
375 kill_orphaned_pgrp(struct task_struct *tsk, struct task_struct *parent) in kill_orphaned_pgrp() argument
377 struct pid *pgrp = task_pgrp(tsk); in kill_orphaned_pgrp()
378 struct task_struct *ignored_task = tsk; in kill_orphaned_pgrp()
384 parent = tsk->real_parent; in kill_orphaned_pgrp()
392 task_session(parent) == task_session(tsk) && in kill_orphaned_pgrp()
400 static void coredump_task_exit(struct task_struct *tsk) in coredump_task_exit() argument
411 spin_lock_irq(&tsk->sighand->siglock); in coredump_task_exit()
412 tsk->flags |= PF_POSTCOREDUMP; in coredump_task_exit()
413 core_state = tsk->signal->core_state; in coredump_task_exit()
414 spin_unlock_irq(&tsk->sighand->siglock); in coredump_task_exit()
726 static void exit_notify(struct task_struct *tsk, int group_dead) in exit_notify() argument
733 forget_original_parent(tsk, &dead); in exit_notify()
736 kill_orphaned_pgrp(tsk->group_leader, NULL); in exit_notify()
738 tsk->exit_state = EXIT_ZOMBIE; in exit_notify()
739 if (unlikely(tsk->ptrace)) { in exit_notify()
740 int sig = thread_group_leader(tsk) && in exit_notify()
741 thread_group_empty(tsk) && in exit_notify()
742 !ptrace_reparented(tsk) ? in exit_notify()
743 tsk->exit_signal : SIGCHLD; in exit_notify()
744 autoreap = do_notify_parent(tsk, sig); in exit_notify()
745 } else if (thread_group_leader(tsk)) { in exit_notify()
746 autoreap = thread_group_empty(tsk) && in exit_notify()
747 do_notify_parent(tsk, tsk->exit_signal); in exit_notify()
753 tsk->exit_state = EXIT_DEAD; in exit_notify()
754 list_add(&tsk->ptrace_entry, &dead); in exit_notify()
758 if (unlikely(tsk->signal->notify_count < 0)) in exit_notify()
759 wake_up_process(tsk->signal->group_exec_task); in exit_notify()
792 static void synchronize_group_exit(struct task_struct *tsk, long code) in synchronize_group_exit() argument
794 struct sighand_struct *sighand = tsk->sighand; in synchronize_group_exit()
795 struct signal_struct *signal = tsk->signal; in synchronize_group_exit()
810 struct task_struct *tsk = current; in do_exit() local
815 synchronize_group_exit(tsk, code); in do_exit()
817 WARN_ON(tsk->plug); in do_exit()
819 profile_task_exit(tsk); in do_exit()
820 kcov_task_exit(tsk); in do_exit()
821 kmsan_task_exit(tsk); in do_exit()
823 coredump_task_exit(tsk); in do_exit()
826 validate_creds_for_do_exit(tsk); in do_exit()
829 exit_signals(tsk); /* sets PF_EXITING */ in do_exit()
834 if (tsk->mm) in do_exit()
835 sync_mm_rss(tsk->mm); in do_exit()
836 acct_update_integrals(tsk); in do_exit()
837 group_dead = atomic_dec_and_test(&tsk->signal->live); in do_exit()
843 if (unlikely(is_global_init(tsk))) in do_exit()
845 tsk->signal->group_exit_code ?: (int)code); in do_exit()
848 hrtimer_cancel(&tsk->signal->real_timer); in do_exit()
849 exit_itimers(tsk); in do_exit()
851 if (tsk->mm) in do_exit()
852 setmax_mm_hiwater_rss(&tsk->signal->maxrss, tsk->mm); in do_exit()
857 audit_free(tsk); in do_exit()
859 tsk->exit_code = code; in do_exit()
860 taskstats_exit(tsk, group_dead); in do_exit()
866 trace_sched_process_exit(tsk); in do_exit()
868 exit_sem(tsk); in do_exit()
869 exit_shm(tsk); in do_exit()
870 exit_files(tsk); in do_exit()
871 exit_fs(tsk); in do_exit()
874 exit_task_namespaces(tsk); in do_exit()
875 exit_task_work(tsk); in do_exit()
876 exit_thread(tsk); in do_exit()
884 perf_event_exit_task(tsk); in do_exit()
886 sched_autogroup_exit_task(tsk); in do_exit()
887 cgroup_exit(tsk); in do_exit()
892 flush_ptrace_hw_breakpoint(tsk); in do_exit()
895 exit_notify(tsk, group_dead); in do_exit()
896 proc_exit_connector(tsk); in do_exit()
897 mpol_put_task_policy(tsk); in do_exit()
907 if (tsk->io_context) in do_exit()
908 exit_io_context(tsk); in do_exit()
910 if (tsk->splice_pipe) in do_exit()
911 free_pipe_info(tsk->splice_pipe); in do_exit()
913 if (tsk->task_frag.page) in do_exit()
914 put_page(tsk->task_frag.page); in do_exit()
916 validate_creds_for_do_exit(tsk); in do_exit()
917 exit_task_stack_account(tsk); in do_exit()
921 if (tsk->nr_dirtied) in do_exit()
922 __this_cpu_add(dirty_throttle_leaks, tsk->nr_dirtied); in do_exit()
926 lockdep_free_task(tsk); in do_exit()
941 struct task_struct *tsk = current; in make_task_dead() local
946 if (unlikely(!tsk->pid)) in make_task_dead()
979 if (unlikely(tsk->flags & PF_EXITING)) { in make_task_dead()
981 futex_exit_recursive(tsk); in make_task_dead()
982 tsk->exit_state = EXIT_DEAD; in make_task_dead()
983 refcount_inc(&tsk->rcu_users); in make_task_dead()
1496 static int do_wait_thread(struct wait_opts *wo, struct task_struct *tsk) in do_wait_thread() argument
1500 list_for_each_entry(p, &tsk->children, sibling) { in do_wait_thread()
1510 static int ptrace_do_wait(struct wait_opts *wo, struct task_struct *tsk) in ptrace_do_wait() argument
1514 list_for_each_entry(p, &tsk->ptraced, ptrace_entry) { in ptrace_do_wait()
1615 struct task_struct *tsk = current; in do_wait() local
1618 retval = do_wait_thread(wo, tsk); in do_wait()
1622 retval = ptrace_do_wait(wo, tsk); in do_wait()
1628 } while_each_thread(current, tsk); in do_wait()