Page MenuHomeFreeBSD

kern: factor `do_fork()` process registration into helpers
Needs ReviewPublic

Authored by inquire_JohnEricson.me on Thu, Aug 6, 4:06 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Aug 18, 5:02 AM
Unknown Object (File)
Tue, Aug 18, 12:54 AM
Unknown Object (File)
Mon, Aug 17, 7:52 PM
Unknown Object (File)
Mon, Aug 17, 4:18 PM
Unknown Object (File)
Sun, Aug 16, 9:42 PM
Unknown Object (File)
Sun, Aug 16, 4:48 PM
Unknown Object (File)
Sun, Aug 16, 11:50 AM
Unknown Object (File)
Sat, Aug 15, 7:54 PM
Subscribers

Details

Reviewers
markj
glebius
kib
Summary

Pure refactor, no functional change. Factor the process-registration
logic out of do_fork into small functions:

  • fork_register_proc: PID assignment and insertion into the global process lists (allproc, pidhash, tidhash) and prison
  • fork_proc_tree: process group join, parent/reaper attachment

This is preparation for adding a second consumer of this logic: the
pdnew family of syscalls implementing the process creation model
proposed in
https://lists.freebsd.org/archives/freebsd-arch/2022-January/000140.html

Note: This patch overall series is very big, more than I feel competent
reviewing, so I feel a bit ill-mannered submitting it yet. Certainly,
everyone should feel free to ignore it until my "unix socket connectat"
series is landed. I am submitting it now anyway simply because I think
the end functionality is very cool, and I don't want it to grow dusty on
my machine.

Assisted-by: Claude Code (Claude Opus 4.8/5 and Fable 5)

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 75408
Build 72291: arc lint + arc unit