Page MenuHomeFreeBSD

Manage process-related IDs with bitmaps
ClosedPublic

Authored by mjg on Dec 5 2018, 3:28 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 21 2024, 8:59 PM
Unknown Object (File)
Dec 20 2023, 4:02 AM
Unknown Object (File)
Nov 7 2023, 2:24 PM
Unknown Object (File)
Oct 6 2023, 1:04 PM
Unknown Object (File)
Mar 12 2023, 12:50 PM
Subscribers

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
Tests Skipped
Build Status
Buildable 21366

Event Timeline

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

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

This already landed in r342237, I see I forgot to add the line.