Lines Matching refs:tsk
518 struct task_struct *tsk = current; in flush_itimer_signals() local
521 spin_lock_irqsave(&tsk->sighand->siglock, flags); in flush_itimer_signals()
522 __flush_itimer_signals(&tsk->pending); in flush_itimer_signals()
523 __flush_itimer_signals(&tsk->signal->shared_pending); in flush_itimer_signals()
524 spin_unlock_irqrestore(&tsk->sighand->siglock, flags); in flush_itimer_signals()
559 bool unhandled_signal(struct task_struct *tsk, int sig) in unhandled_signal() argument
561 void __user *handler = tsk->sighand->action[sig-1].sa.sa_handler; in unhandled_signal()
562 if (is_global_init(tsk)) in unhandled_signal()
569 if (fatal_signal_pending(tsk)) in unhandled_signal()
573 return !tsk->ptrace; in unhandled_signal()
637 int dequeue_signal(struct task_struct *tsk, sigset_t *mask, in dequeue_signal() argument
647 signr = __dequeue_signal(&tsk->pending, mask, info, &resched_timer); in dequeue_signal()
650 signr = __dequeue_signal(&tsk->signal->shared_pending, in dequeue_signal()
667 struct hrtimer *tmr = &tsk->signal->real_timer; in dequeue_signal()
670 tsk->signal->it_real_incr != 0) { in dequeue_signal()
672 tsk->signal->it_real_incr); in dequeue_signal()
706 spin_unlock(&tsk->sighand->siglock); in dequeue_signal()
708 spin_lock(&tsk->sighand->siglock); in dequeue_signal()
720 struct task_struct *tsk = current; in dequeue_synchronous_signal() local
721 struct sigpending *pending = &tsk->pending; in dequeue_synchronous_signal()
727 if (!((pending->signal.sig[0] & ~tsk->blocked.sig[0]) & SYNCHRONOUS_MASK)) in dequeue_synchronous_signal()
1398 struct sighand_struct *__lock_task_sighand(struct task_struct *tsk, in __lock_task_sighand() argument
1405 sighand = rcu_dereference(tsk->sighand); in __lock_task_sighand()
1421 if (likely(sighand == rcu_access_pointer(tsk->sighand))) in __lock_task_sighand()
2047 bool do_notify_parent(struct task_struct *tsk, int sig) in do_notify_parent() argument
2058 WARN_ON_ONCE(task_is_stopped_or_traced(tsk)); in do_notify_parent()
2060 WARN_ON_ONCE(!tsk->ptrace && in do_notify_parent()
2061 (tsk->group_leader != tsk || !thread_group_empty(tsk))); in do_notify_parent()
2064 do_notify_pidfd(tsk); in do_notify_parent()
2071 if (tsk->parent_exec_id != READ_ONCE(tsk->parent->self_exec_id)) in do_notify_parent()
2090 info.si_pid = task_pid_nr_ns(tsk, task_active_pid_ns(tsk->parent)); in do_notify_parent()
2091 info.si_uid = from_kuid_munged(task_cred_xxx(tsk->parent, user_ns), in do_notify_parent()
2092 task_uid(tsk)); in do_notify_parent()
2095 task_cputime(tsk, &utime, &stime); in do_notify_parent()
2096 info.si_utime = nsec_to_clock_t(utime + tsk->signal->utime); in do_notify_parent()
2097 info.si_stime = nsec_to_clock_t(stime + tsk->signal->stime); in do_notify_parent()
2099 info.si_status = tsk->exit_code & 0x7f; in do_notify_parent()
2100 if (tsk->exit_code & 0x80) in do_notify_parent()
2102 else if (tsk->exit_code & 0x7f) in do_notify_parent()
2106 info.si_status = tsk->exit_code >> 8; in do_notify_parent()
2109 psig = tsk->parent->sighand; in do_notify_parent()
2111 if (!tsk->ptrace && sig == SIGCHLD && in do_notify_parent()
2138 __send_signal_locked(sig, &info, tsk->parent, PIDTYPE_TGID, false); in do_notify_parent()
2139 __wake_up_parent(tsk, tsk->parent); in do_notify_parent()
2158 static void do_notify_parent_cldstop(struct task_struct *tsk, in do_notify_parent_cldstop() argument
2168 parent = tsk->parent; in do_notify_parent_cldstop()
2170 tsk = tsk->group_leader; in do_notify_parent_cldstop()
2171 parent = tsk->real_parent; in do_notify_parent_cldstop()
2181 info.si_pid = task_pid_nr_ns(tsk, task_active_pid_ns(parent)); in do_notify_parent_cldstop()
2182 info.si_uid = from_kuid_munged(task_cred_xxx(parent, user_ns), task_uid(tsk)); in do_notify_parent_cldstop()
2185 task_cputime(tsk, &utime, &stime); in do_notify_parent_cldstop()
2195 info.si_status = tsk->signal->group_exit_code & 0x7f; in do_notify_parent_cldstop()
2198 info.si_status = tsk->exit_code & 0x7f; in do_notify_parent_cldstop()
2212 __wake_up_parent(tsk, parent); in do_notify_parent_cldstop()
2936 static void retarget_shared_pending(struct task_struct *tsk, sigset_t *which) in retarget_shared_pending() argument
2941 sigandsets(&retarget, &tsk->signal->shared_pending.signal, which); in retarget_shared_pending()
2945 t = tsk; in retarget_shared_pending()
2946 while_each_thread(tsk, t) { in retarget_shared_pending()
2963 void exit_signals(struct task_struct *tsk) in exit_signals() argument
2972 cgroup_threadgroup_change_begin(tsk); in exit_signals()
2974 if (thread_group_empty(tsk) || (tsk->signal->flags & SIGNAL_GROUP_EXIT)) { in exit_signals()
2975 tsk->flags |= PF_EXITING; in exit_signals()
2976 cgroup_threadgroup_change_end(tsk); in exit_signals()
2980 spin_lock_irq(&tsk->sighand->siglock); in exit_signals()
2985 tsk->flags |= PF_EXITING; in exit_signals()
2987 cgroup_threadgroup_change_end(tsk); in exit_signals()
2989 if (!task_sigpending(tsk)) in exit_signals()
2992 unblocked = tsk->blocked; in exit_signals()
2994 retarget_shared_pending(tsk, &unblocked); in exit_signals()
2996 if (unlikely(tsk->jobctl & JOBCTL_STOP_PENDING) && in exit_signals()
2997 task_participate_group_stop(tsk)) in exit_signals()
3000 spin_unlock_irq(&tsk->sighand->siglock); in exit_signals()
3008 do_notify_parent_cldstop(tsk, false, group_stop); in exit_signals()
3031 static void __set_task_blocked(struct task_struct *tsk, const sigset_t *newset) in __set_task_blocked() argument
3033 if (task_sigpending(tsk) && !thread_group_empty(tsk)) { in __set_task_blocked()
3037 retarget_shared_pending(tsk, &newblocked); in __set_task_blocked()
3039 tsk->blocked = *newset; in __set_task_blocked()
3058 struct task_struct *tsk = current; in __set_current_blocked() local
3064 if (sigequalsets(&tsk->blocked, newset)) in __set_current_blocked()
3067 spin_lock_irq(&tsk->sighand->siglock); in __set_current_blocked()
3068 __set_task_blocked(tsk, newset); in __set_current_blocked()
3069 spin_unlock_irq(&tsk->sighand->siglock); in __set_current_blocked()
3082 struct task_struct *tsk = current; in sigprocmask() local
3087 *oldset = tsk->blocked; in sigprocmask()
3091 sigorsets(&newset, &tsk->blocked, set); in sigprocmask()
3094 sigandnsets(&newset, &tsk->blocked, set); in sigprocmask()
3594 struct task_struct *tsk = current; in do_sigtimedwait() local
3612 spin_lock_irq(&tsk->sighand->siglock); in do_sigtimedwait()
3613 sig = dequeue_signal(tsk, &mask, info, &type); in do_sigtimedwait()
3621 tsk->real_blocked = tsk->blocked; in do_sigtimedwait()
3622 sigandsets(&tsk->blocked, &tsk->blocked, &mask); in do_sigtimedwait()
3624 spin_unlock_irq(&tsk->sighand->siglock); in do_sigtimedwait()
3627 ret = schedule_hrtimeout_range(to, tsk->timer_slack_ns, in do_sigtimedwait()
3629 spin_lock_irq(&tsk->sighand->siglock); in do_sigtimedwait()
3630 __set_task_blocked(tsk, &tsk->real_blocked); in do_sigtimedwait()
3631 sigemptyset(&tsk->real_blocked); in do_sigtimedwait()
3632 sig = dequeue_signal(tsk, &mask, info, &type); in do_sigtimedwait()
3634 spin_unlock_irq(&tsk->sighand->siglock); in do_sigtimedwait()