- change utrace_get_signal() to check JOBCTL_STOP_PENDING instead of signal->group_stop_count. With the recent changes group_stop_count doesn't necessarily mean this task should participate in group stop.
- remove the "participate in group stop" code from utrace_wakeup() and utrace_stop(), this is no longer needed and wrong.
Signed-off-by: Oleg Nesterov oleg@redhat.com --- kernel/utrace.c | 16 ++-------------- 1 files changed, 2 insertions(+), 14 deletions(-)
diff --git a/kernel/utrace.c b/kernel/utrace.c index 1e750ad..5d3974e 100644 --- a/kernel/utrace.c +++ b/kernel/utrace.c @@ -648,11 +648,7 @@ static void utrace_wakeup(struct task_struct *target, struct utrace *utrace) { lockdep_assert_held(&utrace->lock); spin_lock_irq(&target->sighand->siglock); - if (target->signal->flags & SIGNAL_STOP_STOPPED || - target->signal->group_stop_count) - target->state = TASK_STOPPED; - else - wake_up_state(target, __TASK_TRACED); + wake_up_state(target, __TASK_TRACED); spin_unlock_irq(&target->sighand->siglock); }
@@ -805,14 +801,6 @@ relock:
__set_current_state(TASK_TRACED);
- /* - * If there is a group stop in progress, - * we must participate in the bookkeeping. - */ - if (unlikely(task->signal->group_stop_count) && - !--task->signal->group_stop_count) - task->signal->flags = SIGNAL_STOP_STOPPED; - spin_unlock_irq(&task->sighand->siglock); spin_unlock(&utrace->lock);
@@ -2037,7 +2025,7 @@ int utrace_get_signal(struct task_struct *task, struct pt_regs *regs, ka = NULL; memset(return_ka, 0, sizeof *return_ka); } else if (!(task->utrace_flags & UTRACE_EVENT_SIGNAL_ALL) || - unlikely(task->signal->group_stop_count)) { + unlikely(task->jobctl & JOBCTL_STOP_PENDING)) { /* * If no engine is interested in intercepting signals or * we must stop, let the caller just dequeue them normally