Re: [PATCH 1/5] sched,signal,ptrace: Rework TASK_TRACED, TASK_STOPPED state

From: Peter Zijlstra
Date: Wed Apr 13 2022 - 12:48:06 EST


On Wed, Apr 13, 2022 at 03:29:22PM +0200, Oleg Nesterov wrote:
> On 04/12, Peter Zijlstra wrote:
> >
> > @@ -475,8 +483,10 @@ static int ptrace_attach(struct task_str
> > * in and out of STOPPED are protected by siglock.
> > */
> > if (task_is_stopped(task) &&
> > - task_set_jobctl_pending(task, JOBCTL_TRAP_STOP | JOBCTL_TRAPPING))
> > + task_set_jobctl_pending(task, JOBCTL_TRAP_STOP | JOBCTL_TRAPPING)) {
> > + task->jobctl &= ~JOBCTL_STOPPED;
> > signal_wake_up_state(task, __TASK_STOPPED);
>
> OK, but just for record before I forget...
>
> It seems that we can s/JOBCTL_STOPPED/JOBCTL_TRACED/ instead, and kill the
> nasty wait_on_bit(JOBCTL_TRAPPING_BIT) along with JOBCTL_TRAPPING_BIT. Sure,
> this doesn't belong to this series.

I'm afraid I didn't look hard enough at that part to really understand
it, but some cleanup around there sounds lovely.