Commit 780006eac2fe7f4d2582da16a096e5a44c4767ff

Authored by Oleg Nesterov
Committed by Tejun Heo
1 parent 1deac632fc

signal: do_signal_stop: Remove the unneeded task_clear_group_stop_pending()

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>

Showing 1 changed file with 2 additions and 3 deletions Side-by-side Diff

... ... @@ -1866,7 +1866,8 @@
1866 1866 * still in effect and then receive a stop signal and
1867 1867 * initiate another group stop. This deviates from the
1868 1868 * usual behavior as two consecutive stop signals can't
1869   - * cause two group stops when !ptraced.
  1869 + * cause two group stops when !ptraced. That is why we
  1870 + * also check !task_is_stopped(t) below.
1870 1871 *
1871 1872 * The condition can be distinguished by testing whether
1872 1873 * SIGNAL_STOP_STOPPED is already set. Don't generate
... ... @@ -1896,8 +1897,6 @@
1896 1897 t->group_stop |= signr | gstop;
1897 1898 sig->group_stop_count++;
1898 1899 signal_wake_up(t, 0);
1899   - } else {
1900   - task_clear_group_stop_pending(t);
1901 1900 }
1902 1901 }
1903 1902 }