Lines Matching refs:tsk

92 static void __exit_signal(struct task_struct *tsk)  in __exit_signal()  argument
94 struct signal_struct *sig = tsk->signal; in __exit_signal()
95 bool group_dead = thread_group_leader(tsk); in __exit_signal()
100 sighand = rcu_dereference_check(tsk->sighand, in __exit_signal()
105 posix_cpu_timers_exit(tsk); in __exit_signal()
107 posix_cpu_timers_exit_group(tsk); in __exit_signal()
121 if (tsk == sig->curr_target) in __exit_signal()
122 sig->curr_target = next_thread(tsk); in __exit_signal()
125 add_device_randomness((const void*) &tsk->se.sum_exec_runtime, in __exit_signal()
134 task_cputime(tsk, &utime, &stime); in __exit_signal()
138 sig->gtime += task_gtime(tsk); in __exit_signal()
139 sig->min_flt += tsk->min_flt; in __exit_signal()
140 sig->maj_flt += tsk->maj_flt; in __exit_signal()
141 sig->nvcsw += tsk->nvcsw; in __exit_signal()
142 sig->nivcsw += tsk->nivcsw; in __exit_signal()
143 sig->inblock += task_io_get_inblock(tsk); in __exit_signal()
144 sig->oublock += task_io_get_oublock(tsk); in __exit_signal()
145 task_io_accounting_add(&sig->ioac, &tsk->ioac); in __exit_signal()
146 sig->sum_sched_runtime += tsk->se.sum_exec_runtime; in __exit_signal()
148 __unhash_process(tsk, group_dead); in __exit_signal()
155 flush_sigqueue(&tsk->pending); in __exit_signal()
156 tsk->sighand = NULL; in __exit_signal()
160 clear_tsk_thread_flag(tsk, TIF_SIGPENDING); in __exit_signal()
169 struct task_struct *tsk = container_of(rhp, struct task_struct, rcu); in delayed_put_task_struct() local
171 kprobe_flush_task(tsk); in delayed_put_task_struct()
172 perf_event_delayed_put(tsk); in delayed_put_task_struct()
173 trace_sched_process_free(tsk); in delayed_put_task_struct()
174 put_task_struct(tsk); in delayed_put_task_struct()
318 kill_orphaned_pgrp(struct task_struct *tsk, struct task_struct *parent) in kill_orphaned_pgrp() argument
320 struct pid *pgrp = task_pgrp(tsk); in kill_orphaned_pgrp()
321 struct task_struct *ignored_task = tsk; in kill_orphaned_pgrp()
327 parent = tsk->real_parent; in kill_orphaned_pgrp()
335 task_session(parent) == task_session(tsk) && in kill_orphaned_pgrp()
343 static void coredump_task_exit(struct task_struct *tsk) in coredump_task_exit() argument
354 spin_lock_irq(&tsk->sighand->siglock); in coredump_task_exit()
355 tsk->flags |= PF_POSTCOREDUMP; in coredump_task_exit()
356 core_state = tsk->signal->core_state; in coredump_task_exit()
357 spin_unlock_irq(&tsk->sighand->siglock); in coredump_task_exit()
667 static void exit_notify(struct task_struct *tsk, int group_dead) in exit_notify() argument
674 forget_original_parent(tsk, &dead); in exit_notify()
677 kill_orphaned_pgrp(tsk->group_leader, NULL); in exit_notify()
679 tsk->exit_state = EXIT_ZOMBIE; in exit_notify()
680 if (unlikely(tsk->ptrace)) { in exit_notify()
681 int sig = thread_group_leader(tsk) && in exit_notify()
682 thread_group_empty(tsk) && in exit_notify()
683 !ptrace_reparented(tsk) ? in exit_notify()
684 tsk->exit_signal : SIGCHLD; in exit_notify()
685 autoreap = do_notify_parent(tsk, sig); in exit_notify()
686 } else if (thread_group_leader(tsk)) { in exit_notify()
687 autoreap = thread_group_empty(tsk) && in exit_notify()
688 do_notify_parent(tsk, tsk->exit_signal); in exit_notify()
694 tsk->exit_state = EXIT_DEAD; in exit_notify()
695 list_add(&tsk->ptrace_entry, &dead); in exit_notify()
699 if (unlikely(tsk->signal->notify_count < 0)) in exit_notify()
700 wake_up_process(tsk->signal->group_exit_task); in exit_notify()
735 struct task_struct *tsk = current; in do_exit() local
745 WARN_ON(blk_needs_flush_plug(tsk)); in do_exit()
749 if (unlikely(!tsk->pid)) in do_exit()
768 profile_task_exit(tsk); in do_exit()
769 kcov_task_exit(tsk); in do_exit()
771 coredump_task_exit(tsk); in do_exit()
774 validate_creds_for_do_exit(tsk); in do_exit()
780 if (unlikely(tsk->flags & PF_EXITING)) { in do_exit()
782 futex_exit_recursive(tsk); in do_exit()
788 exit_signals(tsk); /* sets PF_EXITING */ in do_exit()
791 if (tsk->mm) in do_exit()
792 sync_mm_rss(tsk->mm); in do_exit()
793 acct_update_integrals(tsk); in do_exit()
794 group_dead = atomic_dec_and_test(&tsk->signal->live); in do_exit()
800 if (unlikely(is_global_init(tsk))) in do_exit()
802 tsk->signal->group_exit_code ?: (int)code); in do_exit()
805 hrtimer_cancel(&tsk->signal->real_timer); in do_exit()
806 exit_itimers(tsk->signal); in do_exit()
808 if (tsk->mm) in do_exit()
809 setmax_mm_hiwater_rss(&tsk->signal->maxrss, tsk->mm); in do_exit()
814 audit_free(tsk); in do_exit()
816 tsk->exit_code = code; in do_exit()
817 taskstats_exit(tsk, group_dead); in do_exit()
823 trace_sched_process_exit(tsk); in do_exit()
825 exit_sem(tsk); in do_exit()
826 exit_shm(tsk); in do_exit()
827 exit_files(tsk); in do_exit()
828 exit_fs(tsk); in do_exit()
831 exit_task_namespaces(tsk); in do_exit()
832 exit_task_work(tsk); in do_exit()
833 exit_thread(tsk); in do_exit()
841 perf_event_exit_task(tsk); in do_exit()
843 sched_autogroup_exit_task(tsk); in do_exit()
844 cgroup_exit(tsk); in do_exit()
849 flush_ptrace_hw_breakpoint(tsk); in do_exit()
852 exit_notify(tsk, group_dead); in do_exit()
853 proc_exit_connector(tsk); in do_exit()
854 mpol_put_task_policy(tsk); in do_exit()
864 if (tsk->io_context) in do_exit()
865 exit_io_context(tsk); in do_exit()
867 if (tsk->splice_pipe) in do_exit()
868 free_pipe_info(tsk->splice_pipe); in do_exit()
870 if (tsk->task_frag.page) in do_exit()
871 put_page(tsk->task_frag.page); in do_exit()
873 validate_creds_for_do_exit(tsk); in do_exit()
877 if (tsk->nr_dirtied) in do_exit()
878 __this_cpu_add(dirty_throttle_leaks, tsk->nr_dirtied); in do_exit()
882 lockdep_free_task(tsk); in do_exit()
1399 static int do_wait_thread(struct wait_opts *wo, struct task_struct *tsk) in do_wait_thread() argument
1403 list_for_each_entry(p, &tsk->children, sibling) { in do_wait_thread()
1413 static int ptrace_do_wait(struct wait_opts *wo, struct task_struct *tsk) in ptrace_do_wait() argument
1417 list_for_each_entry(p, &tsk->ptraced, ptrace_entry) { in ptrace_do_wait()
1518 struct task_struct *tsk = current; in do_wait() local
1521 retval = do_wait_thread(wo, tsk); in do_wait()
1525 retval = ptrace_do_wait(wo, tsk); in do_wait()
1531 } while_each_thread(current, tsk); in do_wait()