Skip to content

Commit

Permalink
signal: do_signal_stop: Remove the unneeded task_clear_group_stop_pen…
Browse files Browse the repository at this point in the history
…ding()

PF_EXITING or TASK_STOPPED has already called task_participate_group_stop()
and cleared its ->group_stop. No need to do task_clear_group_stop_pending()
when we start the new group stop.

Add a small comment to explain the !task_is_stopped() check. Note that this
check is not exactly right and it can lead to unnecessary stop later if the
thread is TASK_PTRACED. What we need is task_participated_in_group_stop(),
this will be solved later.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
  • Loading branch information
Oleg Nesterov authored and Tejun Heo committed Apr 4, 2011
1 parent 1deac63 commit 780006e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1866,7 +1866,8 @@ static int do_signal_stop(int signr)
* still in effect and then receive a stop signal and
* initiate another group stop. This deviates from the
* usual behavior as two consecutive stop signals can't
* cause two group stops when !ptraced.
* cause two group stops when !ptraced. That is why we
* also check !task_is_stopped(t) below.
*
* The condition can be distinguished by testing whether
* SIGNAL_STOP_STOPPED is already set. Don't generate
Expand Down Expand Up @@ -1896,8 +1897,6 @@ static int do_signal_stop(int signr)
t->group_stop |= signr | gstop;
sig->group_stop_count++;
signal_wake_up(t, 0);
} else {
task_clear_group_stop_pending(t);
}
}
}
Expand Down

0 comments on commit 780006e

Please sign in to comment.