@@ -124,7 +124,7 @@ static inline int has_pending_signals(sigset_t *signal, sigset_t *blocked)
124124
125125static int recalc_sigpending_tsk (struct task_struct * t )
126126{
127- if ((t -> group_stop & GROUP_STOP_PENDING ) ||
127+ if ((t -> jobctl & JOBCTL_STOP_PENDING ) ||
128128 PENDING (& t -> pending , & t -> blocked ) ||
129129 PENDING (& t -> signal -> shared_pending , & t -> blocked )) {
130130 set_tsk_thread_flag (t , TIF_SIGPENDING );
@@ -224,47 +224,48 @@ static inline void print_dropped_signal(int sig)
224224}
225225
226226/**
227- * task_clear_group_stop_trapping - clear group stop trapping bit
227+ * task_clear_jobctl_trapping - clear jobctl trapping bit
228228 * @task: target task
229229 *
230- * If GROUP_STOP_TRAPPING is set, a ptracer is waiting for us. Clear it
231- * and wake up the ptracer. Note that we don't need any further locking.
232- * @task->siglock guarantees that @task->parent points to the ptracer.
230+ * If JOBCTL_TRAPPING is set, a ptracer is waiting for us to enter TRACED.
231+ * Clear it and wake up the ptracer. Note that we don't need any further
232+ * locking. @task->siglock guarantees that @task->parent points to the
233+ * ptracer.
233234 *
234235 * CONTEXT:
235236 * Must be called with @task->sighand->siglock held.
236237 */
237- static void task_clear_group_stop_trapping (struct task_struct * task )
238+ static void task_clear_jobctl_trapping (struct task_struct * task )
238239{
239- if (unlikely (task -> group_stop & GROUP_STOP_TRAPPING )) {
240- task -> group_stop &= ~GROUP_STOP_TRAPPING ;
240+ if (unlikely (task -> jobctl & JOBCTL_TRAPPING )) {
241+ task -> jobctl &= ~JOBCTL_TRAPPING ;
241242 __wake_up_sync_key (& task -> parent -> signal -> wait_chldexit ,
242243 TASK_UNINTERRUPTIBLE , 1 , task );
243244 }
244245}
245246
246247/**
247- * task_clear_group_stop_pending - clear pending group stop
248+ * task_clear_jobctl_stop_pending - clear pending group stop
248249 * @task: target task
249250 *
250251 * Clear group stop states for @task.
251252 *
252253 * CONTEXT:
253254 * Must be called with @task->sighand->siglock held.
254255 */
255- void task_clear_group_stop_pending (struct task_struct * task )
256+ void task_clear_jobctl_stop_pending (struct task_struct * task )
256257{
257- task -> group_stop &= ~(GROUP_STOP_PENDING | GROUP_STOP_CONSUME |
258- GROUP_STOP_DEQUEUED );
258+ task -> jobctl &= ~(JOBCTL_STOP_PENDING | JOBCTL_STOP_CONSUME |
259+ JOBCTL_STOP_DEQUEUED );
259260}
260261
261262/**
262263 * task_participate_group_stop - participate in a group stop
263264 * @task: task participating in a group stop
264265 *
265- * @task has GROUP_STOP_PENDING set and is participating in a group stop.
266+ * @task has %JOBCTL_STOP_PENDING set and is participating in a group stop.
266267 * Group stop states are cleared and the group stop count is consumed if
267- * %GROUP_STOP_CONSUME was set. If the consumption completes the group
268+ * %JOBCTL_STOP_CONSUME was set. If the consumption completes the group
268269 * stop, the appropriate %SIGNAL_* flags are set.
269270 *
270271 * CONTEXT:
@@ -277,11 +278,11 @@ void task_clear_group_stop_pending(struct task_struct *task)
277278static bool task_participate_group_stop (struct task_struct * task )
278279{
279280 struct signal_struct * sig = task -> signal ;
280- bool consume = task -> group_stop & GROUP_STOP_CONSUME ;
281+ bool consume = task -> jobctl & JOBCTL_STOP_CONSUME ;
281282
282- WARN_ON_ONCE (!(task -> group_stop & GROUP_STOP_PENDING ));
283+ WARN_ON_ONCE (!(task -> jobctl & JOBCTL_STOP_PENDING ));
283284
284- task_clear_group_stop_pending (task );
285+ task_clear_jobctl_stop_pending (task );
285286
286287 if (!consume )
287288 return false;
@@ -604,7 +605,7 @@ int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info)
604605 * is to alert stop-signal processing code when another
605606 * processor has come along and cleared the flag.
606607 */
607- current -> group_stop |= GROUP_STOP_DEQUEUED ;
608+ current -> jobctl |= JOBCTL_STOP_DEQUEUED ;
608609 }
609610 if ((info -> si_code & __SI_MASK ) == __SI_TIMER && info -> si_sys_private ) {
610611 /*
@@ -809,7 +810,7 @@ static int prepare_signal(int sig, struct task_struct *p, int from_ancestor_ns)
809810 rm_from_queue (SIG_KERNEL_STOP_MASK , & signal -> shared_pending );
810811 t = p ;
811812 do {
812- task_clear_group_stop_pending (t );
813+ task_clear_jobctl_stop_pending (t );
813814 rm_from_queue (SIG_KERNEL_STOP_MASK , & t -> pending );
814815 wake_up_state (t , __TASK_STOPPED );
815816 } while_each_thread (p , t );
@@ -925,7 +926,7 @@ static void complete_signal(int sig, struct task_struct *p, int group)
925926 signal -> group_stop_count = 0 ;
926927 t = p ;
927928 do {
928- task_clear_group_stop_pending (t );
929+ task_clear_jobctl_stop_pending (t );
929930 sigaddset (& t -> pending .signal , SIGKILL );
930931 signal_wake_up (t , 1 );
931932 } while_each_thread (p , t );
@@ -1160,7 +1161,7 @@ int zap_other_threads(struct task_struct *p)
11601161 p -> signal -> group_stop_count = 0 ;
11611162
11621163 while_each_thread (p , t ) {
1163- task_clear_group_stop_pending (t );
1164+ task_clear_jobctl_stop_pending (t );
11641165 count ++ ;
11651166
11661167 /* Don't bother with already dead threads */
@@ -1738,7 +1739,7 @@ static void ptrace_stop(int exit_code, int why, int clear_code, siginfo_t *info)
17381739 * clear now. We act as if SIGCONT is received after TASK_TRACED
17391740 * is entered - ignore it.
17401741 */
1741- if (why == CLD_STOPPED && (current -> group_stop & GROUP_STOP_PENDING ))
1742+ if (why == CLD_STOPPED && (current -> jobctl & JOBCTL_STOP_PENDING ))
17421743 gstop_done = task_participate_group_stop (current );
17431744
17441745 current -> last_siginfo = info ;
@@ -1751,12 +1752,12 @@ static void ptrace_stop(int exit_code, int why, int clear_code, siginfo_t *info)
17511752 set_current_state (TASK_TRACED );
17521753
17531754 /*
1754- * We're committing to trapping. Clearing GROUP_STOP_TRAPPING and
1755+ * We're committing to trapping. Clearing JOBCTL_TRAPPING and
17551756 * transition to TASK_TRACED should be atomic with respect to
1756- * siglock. This hsould be done after the arch hook as siglock is
1757+ * siglock. This should be done after the arch hook as siglock is
17571758 * released and regrabbed across it.
17581759 */
1759- task_clear_group_stop_trapping (current );
1760+ task_clear_jobctl_trapping (current );
17601761
17611762 spin_unlock_irq (& current -> sighand -> siglock );
17621763 read_lock (& tasklist_lock );
@@ -1792,9 +1793,9 @@ static void ptrace_stop(int exit_code, int why, int clear_code, siginfo_t *info)
17921793 *
17931794 * If @gstop_done, the ptracer went away between group stop
17941795 * completion and here. During detach, it would have set
1795- * GROUP_STOP_PENDING on us and we'll re-enter TASK_STOPPED
1796- * in do_signal_stop() on return, so notifying the real
1797- * parent of the group stop completion is enough.
1796+ * JOBCTL_STOP_PENDING on us and we'll re-enter
1797+ * TASK_STOPPED in do_signal_stop() on return, so notifying
1798+ * the real parent of the group stop completion is enough.
17981799 */
17991800 if (gstop_done )
18001801 do_notify_parent_cldstop (current , false, why );
@@ -1856,14 +1857,14 @@ static int do_signal_stop(int signr)
18561857{
18571858 struct signal_struct * sig = current -> signal ;
18581859
1859- if (!(current -> group_stop & GROUP_STOP_PENDING )) {
1860- unsigned int gstop = GROUP_STOP_PENDING | GROUP_STOP_CONSUME ;
1860+ if (!(current -> jobctl & JOBCTL_STOP_PENDING )) {
1861+ unsigned int gstop = JOBCTL_STOP_PENDING | JOBCTL_STOP_CONSUME ;
18611862 struct task_struct * t ;
18621863
1863- /* signr will be recorded in task->group_stop for retries */
1864- WARN_ON_ONCE (signr & ~GROUP_STOP_SIGMASK );
1864+ /* signr will be recorded in task->jobctl for retries */
1865+ WARN_ON_ONCE (signr & ~JOBCTL_STOP_SIGMASK );
18651866
1866- if (!likely (current -> group_stop & GROUP_STOP_DEQUEUED ) ||
1867+ if (!likely (current -> jobctl & JOBCTL_STOP_DEQUEUED ) ||
18671868 unlikely (signal_group_exit (sig )))
18681869 return 0 ;
18691870 /*
@@ -1890,19 +1891,19 @@ static int do_signal_stop(int signr)
18901891 else
18911892 WARN_ON_ONCE (!task_ptrace (current ));
18921893
1893- current -> group_stop &= ~GROUP_STOP_SIGMASK ;
1894- current -> group_stop |= signr | gstop ;
1894+ current -> jobctl &= ~JOBCTL_STOP_SIGMASK ;
1895+ current -> jobctl |= signr | gstop ;
18951896 sig -> group_stop_count = 1 ;
18961897 for (t = next_thread (current ); t != current ;
18971898 t = next_thread (t )) {
1898- t -> group_stop &= ~GROUP_STOP_SIGMASK ;
1899+ t -> jobctl &= ~JOBCTL_STOP_SIGMASK ;
18991900 /*
19001901 * Setting state to TASK_STOPPED for a group
19011902 * stop is always done with the siglock held,
19021903 * so this check has no races.
19031904 */
19041905 if (!(t -> flags & PF_EXITING ) && !task_is_stopped (t )) {
1905- t -> group_stop |= signr | gstop ;
1906+ t -> jobctl |= signr | gstop ;
19061907 sig -> group_stop_count ++ ;
19071908 signal_wake_up (t , 0 );
19081909 }
@@ -1943,23 +1944,23 @@ static int do_signal_stop(int signr)
19431944
19441945 spin_lock_irq (& current -> sighand -> siglock );
19451946 } else {
1946- ptrace_stop (current -> group_stop & GROUP_STOP_SIGMASK ,
1947+ ptrace_stop (current -> jobctl & JOBCTL_STOP_SIGMASK ,
19471948 CLD_STOPPED , 0 , NULL );
19481949 current -> exit_code = 0 ;
19491950 }
19501951
19511952 /*
1952- * GROUP_STOP_PENDING could be set if another group stop has
1953+ * JOBCTL_STOP_PENDING could be set if another group stop has
19531954 * started since being woken up or ptrace wants us to transit
19541955 * between TASK_STOPPED and TRACED. Retry group stop.
19551956 */
1956- if (current -> group_stop & GROUP_STOP_PENDING ) {
1957- WARN_ON_ONCE (!(current -> group_stop & GROUP_STOP_SIGMASK ));
1957+ if (current -> jobctl & JOBCTL_STOP_PENDING ) {
1958+ WARN_ON_ONCE (!(current -> jobctl & JOBCTL_STOP_SIGMASK ));
19581959 goto retry ;
19591960 }
19601961
19611962 /* PTRACE_ATTACH might have raced with task killing, clear trapping */
1962- task_clear_group_stop_trapping (current );
1963+ task_clear_jobctl_trapping (current );
19631964
19641965 spin_unlock_irq (& current -> sighand -> siglock );
19651966
@@ -2078,8 +2079,8 @@ int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka,
20782079 if (unlikely (signr != 0 ))
20792080 ka = return_ka ;
20802081 else {
2081- if (unlikely (current -> group_stop &
2082- GROUP_STOP_PENDING ) && do_signal_stop (0 ))
2082+ if (unlikely (current -> jobctl & JOBCTL_STOP_PENDING ) & &
2083+ do_signal_stop (0 ))
20832084 goto relock ;
20842085
20852086 signr = dequeue_signal (current , & current -> blocked ,
@@ -2253,7 +2254,7 @@ void exit_signals(struct task_struct *tsk)
22532254 signotset (& unblocked );
22542255 retarget_shared_pending (tsk , & unblocked );
22552256
2256- if (unlikely (tsk -> group_stop & GROUP_STOP_PENDING ) &&
2257+ if (unlikely (tsk -> jobctl & JOBCTL_STOP_PENDING ) &&
22572258 task_participate_group_stop (tsk ))
22582259 group_stop = CLD_STOPPED ;
22592260out :
0 commit comments