[Sorry for the bogus reply, finger slipped!] > The logic is correct. Just I think it would be tidier to avoid setting > utrace->stopped when the task is dead. It doesn't hurt, but it is not > needed (and _looks_ confusing imho). > > We can just return true, this is enough for the caller.
The theory was that setting the bit would short-circuit future calls. As the code stands, this is also what prevents utrace_set_events() from returning -EINPROGRESS after utrace_control(,,UTRACE_STOP) has returned 0 for the zombie case. [Now responding to 3/3:] > (I am trying to cleanup this code and make it more understandable, but > of course this is subjective). Sure. > utrace_do_stop() considers the dead task without _UTRACE_DEATH_EVENTS > as quiescent. This is correct, but > > - this is only needed for UTRACE_DETACH case Not quite true, as mentioned above. But we can just solve that directly. So I've done that, and then your patches are fine. > - this _looks_ racy, ->exit_state is not protected > > - it is not immediately obvious this check also relies on > utrace_control_dead() which was already called by our > caller. Right. I think this code predates the fix that introduced utrace_control_dead. Thanks, Roland