Skip to content

do_wait() cleanups.

Oleg Nesterov lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 13 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2shift "ptrace implies WUNTRACED" from ptrace_do_wait() to wait_task_stopped()kernel/exit.c+2 -61 reply
2/2introduce "struct wait_opts" to simplify do_wait() patheskernel/exit.c+114 -9711 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchIngo MolnarRoland McGrath
1/2A-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [FOR REVIEW, PATCH 0/2] do_wait() cleanups.

While this is not strictly necessary, I'd like to also cleanup do_wait/etc before changing ptrace internals. Just because this code is still hardly readable, imho. And we are going to complicate this code a little bit.

This trivial change nearly killed me. I didn't expect I will spent all night doing this!!!

The patch is not tested, I am sending it for the early review, because before I do the next changes I'd like to know your opinion: do you agree with this patch "in general" ?

If yes, I'll send the next trivial cleanups on top:

- factor out getrusage() code

- factor out infop filling

- simplify retval/notask_error interaction

- perhaps some small simplifications in do_wait's callers

Naming. I agree in advance with any changes you suggest, and this is another reason I am sending it early.

Also. This is completely off-topic wrt ptrace cleanups, but if we change do_wait() now perhaps it makes sense to optimize do_wait() in PIDTYPE_PID case. In this case we do not need to scan the lists, we can inspect the task directly. This change should be simple, but it will increase .text. Do you think it makes sense?

I do not plan any other cleanups before changing ptrace internals.

Oleg.