HomeFreeBSD

ddb ps: Use the pidhash to enumerate processes not in allproc.

Description

ddb ps: Use the pidhash to enumerate processes not in allproc.

Exiting processes that have been removed from allproc but are still
executing are not yet marked PRS_ZOMBIE, so they were not listed (for
example, if a thread panics during exit1()). To detect these
processes, clear p_list.le_prev to NULL explicitly after removing a
process from the allproc list and check for this sentinel rather than
PRS_ZOMBIE when walking the pidhash.

While here, simplify the pidhash walk to use a single outer loop.

Reviewed by: kib
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D27824

Details

Provenance
jhbAuthored on Jan 1 2021, 12:00 AM
Reviewer
kib
Differential Revision
D27824: ddb ps: Use the pidhash to enumerate processes not in allproc.
Parents
rG68dc94c7d314: Correct and add some comments.
Branches
Unknown
Tags
Unknown