HomeFreeBSD

fork: rework locking around do_fork

Description

fork: rework locking around do_fork

  • move allproc lock into the func, it is of no use prior to it
  • the code would lock p1 and p2 while holding allproc to partially

construct it after it gets added to the list. instead we can do the
work prior to adding anything.

  • protect lastpid with procid_lock

As a side effect we do less work with allproc held.

Sponsored by: The FreeBSD Foundation

Details

Provenance
mjgAuthored on
Parents
rS351174: fork: bump process count before checking for permission to cross the limit
Branches
Unknown
Tags
Unknown