• R
    tracehook: release_task · dae33574
    Roland McGrath 提交于
    This moves the ptrace-related logic from release_task into tracehook.h and
    ptrace.h inlines.  It provides clean hooks both before and after locking
    tasklist_lock, for future tracing logic to do more cleanup without the
    lock.
    
    This also changes release_task() itself in the rare "zap_leader" case to
    set the leader to EXIT_DEAD before iterating.  This maintains the
    invariant that release_task() only ever handles a task in EXIT_DEAD.  This
    is a common-sense invariant that is already always true except in this one
    arcane case of zombie leader whose parent ignores SIGCHLD.
    
    This change is harmless and only costs one store in this one rare case.
    It keeps the expected state more consisently sane, which is nicer when
    debugging weirdness in release_task().  It also lets some future code in
    the tracehook entry points rely on this invariant for bookkeeping.
    Signed-off-by: NRoland McGrath <roland@redhat.com>
    Cc: Oleg Nesterov <oleg@tv-sign.ru>
    Reviewed-by: NIngo Molnar <mingo@elte.hu>
    Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
    dae33574
tracehook.h 9.2 KB