]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
ddb ps: Use the pidhash to enumerate processes not in allproc.
authorJohn Baldwin <jhb@FreeBSD.org>
Fri, 1 Jan 2021 00:00:05 +0000 (16:00 -0800)
committerJohn Baldwin <jhb@FreeBSD.org>
Fri, 1 Jan 2021 00:00:05 +0000 (16:00 -0800)
commit47877889f2b823f4c2fa135f5f3955ce0b3bdca1
tree55da18dd472ae2d967d5708030fd947f11aed905
parent68dc94c7d314b02ef80fe972f524a2b3c6e68a1c
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
sys/ddb/db_ps.c
sys/kern/kern_exit.c