• Oleg Nesterov's avatar
    ptrace: simplify ptrace_exit()->ignoring_children() path · 6d69cb87
    Oleg Nesterov authored
    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.
    
    Remove spin_lock(->siglock), and kill "int ign" which caches the result of
    ignoring_children() which becomes rather trivial.
    
    Perhaps it makes sense to export this helper, do_notify_parent() can use
    it too.
    Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
    Cc: Jerome Marchand <jmarchan@redhat.com>
    Cc: Roland McGrath <roland@redhat.com>
    Cc: Denys Vlasenko <dvlasenk@redhat.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    6d69cb87
exit.c 45.6 KB