Re: [PATCH v2] ptrace: fix ptrace vs tasklist_lock race on PREEMPT_RT.

Oleg Nesterov
2022-04-05T23:41:45Z

On 04/05, Peter Zijlstra wrote:
>
> As is, I think we can write task_is_stopped() like:
>
> #define task_is_stopped(task) ((task)->jobctl & JOBCTL_STOP_PENDING)
>
> Because jobctl is in fact the canonical state.

Not really. JOBCTL_STOP_PENDING means that the task should stop.

And this flag is cleared right before set_special_state(TASK_STOPPED)
in do_signal_stop(), see task_participate_group_stop().

Oleg.