Page MenuHomeFreeBSD

procctl: add state flags to PROC_REAP_GETPIDS reports
ClosedPublic

Authored by val_packett.cool on Apr 15 2023, 6:03 PM.
Tags
None
Referenced Files
F160578741: D39585.id.diff
Thu, Jun 25, 9:04 PM
Unknown Object (File)
Wed, Jun 24, 5:09 AM
Unknown Object (File)
Tue, Jun 23, 4:09 PM
Unknown Object (File)
Tue, Jun 23, 5:40 AM
Unknown Object (File)
Wed, Jun 17, 2:27 AM
Unknown Object (File)
Mon, Jun 15, 5:07 PM
Unknown Object (File)
Thu, Jun 4, 2:27 PM
Unknown Object (File)
Thu, Jun 4, 2:26 PM

Details

Summary

For a process supervisor using the reaper API to track process subtrees,
it is very useful to know which processes on the list are zombies.

Sponsored by: https://www.patreon.com/valpackett

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I do not object. IMO it would make sense to also report stopped and exiting processes too?

Yeah, agreed.

BTW, is the only difference between P_WEXIT and zombie state is that P_WEXIT gets set earlier in the process?

val_packett.cool retitled this revision from procctl: add a REAPER_PIDINFO_ZOMBIE flag to PROC_REAP_GETPIDS reports to procctl: add state flags to PROC_REAP_GETPIDS reports.Apr 15 2023, 8:07 PM

BTW, is the only difference between P_WEXIT and zombie state is that P_WEXIT gets set earlier in the process?

P_WEXIT processes are not zombies (sometimes).

sys/kern/kern_procctl.c
242

Note that P_WEXIT is kept even for zombies, the flag is not cleared on transition. Perhaps it makes sense to not set EXITING flag for processes that already exited.

Yeah, I guess it would make sense to only report "exiting" when not yet exited.

Please mail me git-formatted patch with all metadata. Also please bump the man page date.

This revision is now accepted and ready to land.Apr 15 2023, 9:14 PM