Page MenuHomeFreeBSD

Manage process-related IDs with bitmaps
AcceptedPublic

Authored by mjg on Wed, Dec 5, 3:28 PM.

Details

Reviewers
kib
Summary

Currently unique pid allocation on fork often requires a full walk of process, group, session lists to make sure it is not used by anything. This has a side effect of requiring proctree to be held along with allproc, which adds more contention in poudriere -j 128.

The patch below implements trivial bitmaps which gets rid of the problem. Dedicated lock is introduced to manage IDs.

While here a bug was discovered: all processes would inherit reap id from the first process spawned by init. This had a side effect of keeping the ID used and when allocation rolls over to the beginning it keeps being skipped.

Test Plan

Added the new scheme alongside the old one and modified do_fork to compare results from both. No mismatches during an entire poudriere run.

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
Build Status
Buildable 21366

Event Timeline

mjg created this revision.Wed, Dec 5, 3:28 PM
kib accepted this revision.Wed, Dec 5, 5:18 PM

I think this can be changed to avoid procid_lock at all.

This revision is now accepted and ready to land.Wed, Dec 5, 5:18 PM