Re: [PATCH 2/4] ptrace: simplify ptrace_exit()->ignoring_children()path

From: Roland McGrath
Date: Wed Feb 04 2009 - 20:10:25 EST


> ignoring_children() takes parent->sighand->siglock and checks
> k_sigaction[SIGCHLD] atomically. But this buys nothing, we can't get
> the "really" wrong result even if we race with sigaction(SIGCHLD).
> If we read the "stale" sa_handler/sa_flags we can pretend it was
> changed right after the check.

Agreed. There is no real synchronization anyway, since sigaction does not
cause reaping of zombies already extant (and POSIX says it does not). All
that really matters is that ignoring_children() never have a false-negative
after sigaction has been called synchronously (i.e. earlier in the same
thread, or in another thread before intervening synchronization preceding
this thread's exit).

> Perhaps it makes sense to export this helper, do_notify_parent() can
> use it too.

It's now quite trivial. Might as well make it a signal.h inline.

> Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx>

Acked-by: Roland McGrath <roland@xxxxxxxxxx>


Thanks,
Roland
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/